classFacts
final class Facts
uses Snapshot
Public API: explicitly declared with
@visibility public.Every context-dependent fact an operation derived, keyed by the statement node it is about.
Facts are established when the operation is constructed and never filled in later. A node of another operation has no fact here.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 + NULL');
$query->facts->scalar($query->field(0)->expression->right)->type instanceof \SqlSemantics\Platform\PostgreSql\Model\Statement\Type\NullOnly // => trueProperties§
public list<Table> $declarationspublic list<Diagnostic> $diagnosticspublic QueryFact|null $outputMethods§
public function __construct(
list<array{Scalar, ScalarFact}> $scalars,
list<array{Node, RelationFact}> $relations,
list<array{Query, QueryFact}> $queries,
list<Table> $declarations,
public QueryFact|null $output,
list<Diagnostic> $diagnostics,
)Parameters
$scalars | list<array{Scalar, ScalarFact}> | The fact of each scalar expression |
$relations | list<array{Node, RelationFact}> | The fact of each relation occurrence and table use |
$queries | list<array{Query, QueryFact}> | The fact of each query |
$declarations | list<Table> | The relation declarations the statement provides |
$output | QueryFact|null | The rows the statement returns, when it returns rows |
$diagnostics | list<Diagnostic> | The semantic problems of the statement |
Calls 4
- method-call Facts::index() line 64
- static-call Check::listOf() line 67
- class-const Table::class() line 67
- class-const Diagnostic::class() line 68
public function index<TNode of object, TFact of object>(list<array{TNode, TFact}> $pairs): array<int, array{TNode, TFact}>Keys node-fact pairs by node identity, refusing a node that occurs twice.
Parameters
$pairs | list<array{TNode, TFact}> |
Returns
array<int, array{TNode, TFact}>Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Fact\Facts::__construct() packages/sql-semantics-postgres/src/Model/Statement/Fact/Facts.php:64
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Fact\Facts::__construct() packages/sql-semantics-postgres/src/Model/Statement/Fact/Facts.php:65
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Fact\Facts::__construct() packages/sql-semantics-postgres/src/Model/Statement/Fact/Facts.php:66
Calls 2
- function-call
spl_object_idline 83 - static-call Check::input() line 84
public function scalar(Scalar $node): ScalarFactAnswers the facts of a scalar expression of this operation.
Parameters
$node | Scalar |
Returns
Calls 2
- function-call
spl_object_idline 96 - static-call Check::input() line 97
public function relation(Node $node): RelationFactAnswers the facts of a relation occurrence or table use of this operation.
Parameters
$node | Node |
Returns
Calls 2
- function-call
spl_object_idline 107 - static-call Check::input() line 108
Answers the facts of a query of this operation.
Parameters
$node | Query |
Returns
Calls 2
- function-call
spl_object_idline 118 - static-call Check::input() line 119
Private surface 3§
Implementation details, listed for orientation only.
private array<int, array{Scalar, ScalarFact}> $scalarsprivate array<int, array{Node, RelationFact}> $relationsprivate array<int, array{Query, QueryFact}> $queries