classConstructorRule
final class ConstructorRule
Lowers row constructors, array constructors and CASE.
Rule: PG-EXPRESSION-CONSTRUCTOR-001. Scope: row, explicit_row, implicit_row, array_expr, array_expr_list, case_expr, case_arg, when_clause_list, when_clause and case_default. Constructors: RowConstructor, ArrayItems, CaseExpression, CaseBranch. Termination: lists are flattened iteratively; nested array levels recurse on the depth of the tree. Source: https://www.postgresql.org/docs/17/sql-expressions.html#SQL-SYNTAX-ROW-CONSTRUCTORS, https://www.postgresql.org/docs/17/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS, https://www.postgresql.org/docs/17/functions-conditional.html#FUNCTIONS-CASE. Status: Implemented.
Methods§
public function row(Node $row): RowConstructorLowers row, explicit_row or implicit_row.
Parameters
$row | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::row() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:142
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::rowConstructor() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:150
Calls 3
- new RowConstructor line 52
- class-const RowSpelling::Implicit() line 56
- static-call ImplementationGap::production() line 58
public function items(Node $array): ArrayItemsLowers array_expr.
Parameters
$array | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\ConstructorRule::items() packages/sql-semantics-postgres/src/Lowering/Expression/ConstructorRule.php:81
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::arrayLiteral() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:166
Calls 4
- new ArrayItems line 71
- static-call ImplementationGap::production() line 77
- method-call Lowering::items() line 80
- method-call ConstructorRule::items() line 81
public function caseExpression(Node $case): CaseExpressionLowers case_expr.
Parameters
$case | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- static-call ImplementationGap::production() line 96
- method-call Lowering::items() line 99
- new CaseBranch line 104
- new CaseExpression line 107
- method-call ConstructorRule::optional() line 107
Lowers case_arg or case_default: the expression, or null when none is written.
Parameters
$optional | Node | |
$present | string | |
$absent | string |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- static-call ImplementationGap::production() line 122
- function-call
countline 125
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::row() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:142
- new SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::rowConstructor() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:150
- new SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::caseExpression() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:158
- new SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::arrayLiteral() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:166
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::row() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:142
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::rowConstructor() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:150
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::caseExpression() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:158
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\Expressions::arrayLiteral() packages/sql-semantics-postgres/src/Lowering/Expression/Expressions.php:166