classBooleanTest
final class BooleanTest
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A truth-value test: a IS [NOT] TRUE, FALSE or UNKNOWN.
Mirrors PostgreSQL's BooleanTest node.
Rule: PG-BOOLEAN-TEST-001. Facts: boolean, never NULL; an operand that is not boolean is reported. The operand must keep its place before IS (PG-PRECEDENCE-001). Source: https://www.postgresql.org/docs/17/functions-comparison.html. Status: Implemented.
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT NULL IS TRUE')->field(0)->nullability // => \SqlSemantics\Platform\PostgreSql\Model\Statement\Type\Nullability::NotNullProperties§
public Scalar $operandpublic BooleanTestKind $kindMethods§
public function __construct(public Scalar $operand, public BooleanTestKind $kind)Parameters
$operand | Scalar | The tested condition |
$kind | BooleanTestKind | The test |
Calls 4
- static-call Check::input() line 44
- method-call Precedence::before() line 44
- new Precedence line 44
- class-const Precedence::IS() line 44
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operand and checks that it is boolean.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 7
- method-call Derivation::scalar() line 52
- new ScalarFact line 54
- method-call OperandChecks::boolean() line 54
- new OperandChecks line 54
- new Known line 54
- class-const Builtin::Bool() line 54
- class-const Nullability::NotNull() line 54
public function render(Output $out): voidWrites the value and the test.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::node() line 62
- function-call
explodeline 62
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.