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.

Reading an attribute given alonedoctest
$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]
Rejecting a value that is not a Booleandoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\BooleanArgument(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('yes')) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

Methods§

public function __construct(public TypeName|KeywordWord|OperatorName|SignedNumber|StringConstant|null $written = null)

Parameters

$writtenTypeName|KeywordWord|OperatorName|SignedNumber|StringConstant|nullThe value as written; null when the attribute is given alone
Calls 3
public function value(): bool

Answers the Boolean the server reads.

Returns

bool
Test cases 1
Calls 2
public function fits(Reading $reading): bool

Tells whether the reading reads a Boolean.

Parameters

$readingReading

Returns

bool
Test cases 2
Calls 1
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the modifier expressions of a value written as a type name.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
public function render(Output $out): void

Writes the value as written; nothing when the attribute is given alone.

Parameters

$outOutput
Test cases 1
Calls 1

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

Relations§

Instantiated in 1
Type checks 3