classNullLiteral
final class NullLiteral
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.The NULL literal.
Rule: SQLITE-NULL-LITERAL-001. The literal is the NULL value and nothing else. Source: https://sqlite.org/lang_expr.html#literal_values_constants_. Status: Implemented.
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT NULL');
[$query->field(0)->type instanceof \SqlSemantics\Platform\Sqlite\Model\Statement\Type\NullOnly, $query->field(0)->nullability] // => [true, \SqlSemantics\Platform\Sqlite\Model\Statement\Type\Nullability::Nullable]Methods§
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the NULL-only type.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 3
- new ScalarFact line 37
- new NullOnly line 37
- class-const Nullability::Nullable() line 37
public function render(Output $out): voidTest cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 9
LiteralRuleTest::testTermLowersNullAndADecodedStringcallsOutputTest::testLayoutRespellsEachRenderedPieceAndKeepsTheRenderedTextcallsOutputTest::testNodeWritesAChildAndNothingForNullcallsCaseBranchTest::testRenderWritesANewlyBuiltBranchcallsGroupedTest::testDeriveScalarKeepsANullOperandNullcallsBinaryTest::testRefusesIsFollowedByAPrefixNotcallsNullTestTest::testRenderWritesANewlyBuiltTestcallsCompoundTest::testRenderRefusesAnOrderingAfterAValuesArmcallsCompoundTest::testRenderRefusesAnOrderingLeftOnTheLastArmcalls
Relations§
Instantiated in 1
Constant reads 1
Type checks 2
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Expression\LiteralDefaults::null() packages/sql-semantics-sqlite/src/Rules/Definition/Expression/LiteralDefaults.php:64
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Expression\LiteralDefaults::null() packages/sql-semantics-sqlite/src/Rules/Definition/Expression/LiteralDefaults.php:67