classBooleanArgument
final class BooleanArgument
implements AttributeArgument
uses Snapshot
Public API: explicitly declared with
@visibility public.An attribute value read as a Boolean, such as hashes of an operator.
defGetBoolean reads an attribute given alone as true, the integers 0 and 1, and the texts true, false, on and off without regard to case, whether written as a word, a keyword or a string. Source: https://www.postgresql.org/docs/17/sql-createoperator.html, defGetBoolean in src/backend/commands/define.c of PostgreSQL 17.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE OPERATOR === (rightarg = int4, function = f, hashes, merges = off)');
[$operation->statement->definition[2]->value->value(), $operation->statement->definition[3]->value->value()] // => [true, false]new \SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\BooleanArgument(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('yes')) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public TypeName|KeywordWord|OperatorName|SignedNumber|StringConstant|null $written = nullMethods§
public function __construct(public TypeName|KeywordWord|OperatorName|SignedNumber|StringConstant|null $written = null)Parameters
$written | TypeName|KeywordWord|OperatorName|SignedNumber|StringConstant|null | The value as written; null when the attribute is given alone |
Calls 3
- static-call Check::input() line 43
- method-call AttributeReader::boolean() line 43
- new AttributeReader line 43
public function value(): boolAnswers the Boolean the server reads.
Returns
boolTest cases 1
Calls 2
- method-call AttributeReader::boolean() line 51
- new AttributeReader line 51
public function fits(Reading $reading): boolTells whether the reading reads a Boolean.
Parameters
$reading | Reading |
Returns
boolTest cases 2
Calls 1
- class-const Reading::Boolean() line 59
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the modifier expressions of a value written as a type name.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
public function render(Output $out): voidWrites the value as written; nothing when the attribute is given alone.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::node() line 75
Test cases 19§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 14
OperatorClassRuleTest::testChangesLowersAnAttributeWithoutValueAndNonecallsAttributeReaderTest::testReadYieldsTheArgumentOfEachReadingcallsDefineChecksTest::testAggregateReportsMovingSerializationHypotheticalAndBaseTypecallsDefineChecksTest::testBaseTypeReportsTheMissingOutputFunctioncallsDefineChecksTest::testCollationFollowsTheProvidercallsDefineChecksTest::testOperatorTellsAMissingRightArgumentFromMissingArgumentscallsDefineChecksTest::testPresentKeepsTheLastRecognizedAttributeOfEachNamecallsDefineChecksTest::testProvidedReportsWhatOnlyIcuTakescallsDefineChecksTest::testSearchReportsAConfigurationWithParserAndCopycallsAttributeArgumentTest::testEveryReadValueIsAnAttributeArgumentcallsAttributeArgumentTest::testFitsTellsTheReadingOfEachArgumentcallsAttributeTest::testValuedTellsWhetherAValueIsWrittencallsDefineTest::testRejectsAnAttributeOfAnotherCommandcallsDefineTest::testRejectsAnOldStyleAttributeWithoutValuecalls
Relations§
Instantiated in 1
Type checks 3
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::aggregate() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:158
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Routine\DefineChecks::provided() packages/sql-semantics-postgres/src/Rules/Routine/DefineChecks.php:234
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\Attribute::valued() packages/sql-semantics-postgres/src/Statement/Object/Attribute/Attribute.php:70