classSignatureRule
final class SignatureRule
Lowers routine, aggregate and operator signatures and routine parameters.
Rule: PG-SIGNATURE-LOWER-001. Scope: function_with_argtypes, function_with_argtypes_list, func_args, func_args_list, func_arg, arg_class, aggregate_with_argtypes, aggregate_with_argtypes_list, aggr_args, aggr_args_list, aggr_arg, operator_with_argtypes, operator_with_argtypes_list, oper_argtypes. Constructors: RoutineSignature, AggregateSignature, AggregateArguments, OperatorSignature, FunctionParameter. A routine named without parentheses has no argument list; () is an empty one. A parameter keeps the written order of its name and mode and the spelling of IN OUT. The operand types of an operator keep how they are written, including the single type the server rejects. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-dropfunction.html, https://www.postgresql.org/docs/17/sql-dropaggregate.html, https://www.postgresql.org/docs/17/sql-dropoperator.html. Status: Implemented.
Methods§
public function function(Node $signature): RoutineSignatureLowers function_with_argtypes.
Parameters
$signature | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 2
Called from 7
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:174
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:220
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:119
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:120
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OptionRule::alter() packages/sql-semantics-postgres/src/Lowering/Routine/OptionRule.php:207
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:66
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::functions() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:91
Calls 7
- new RoutineSignature line 74
- method-call SignatureRule::arguments() line 74
- new DottedName line 75
- new Name line 75
- method-call Keywords::word() line 75
- new Keywords line 75
- static-call ImplementationGap::production() line 78
public function functions(Node $list): list<RoutineSignature>Lowers function_with_argtypes_list.
Parameters
$list | Node |
Returns
list<RoutineSignature>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:95
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:76
Calls 2
- method-call Lowering::items() line 90
- method-call SignatureRule::function() line 91
public function arguments(Node $arguments): list<FunctionParameter>Lowers func_args.
Parameters
$arguments | Node |
Returns
list<FunctionParameter>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 3
- static-call ImplementationGap::production() line 111
- method-call Lowering::items() line 114
- method-call SignatureRule::parameter() line 115
public function parameter(
Node $argument,
?Scalar $default = null,
?DefaultSpelling $spelling = null,
): FunctionParameterLowers func_arg, with the default value a func_arg_with_default adds.
Parameters
$argument | Node | |
$default | ?Scalar | |
$spelling | ?DefaultSpelling |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:102
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:103
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:104
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::arguments() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:115
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregateList() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:217
Calls 3
- new FunctionParameter line 133
- method-call SignatureRule::mode() line 133
- static-call ImplementationGap::production() line 138
public function mode(Node $mode): ParameterModeLowers arg_class.
Parameters
$mode | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:133
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:134
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:136
Calls 2
- class-const SignatureRule::MODES() line 151
- static-call ImplementationGap::production() line 151
public function aggregate(Node $signature): AggregateSignatureLowers aggregate_with_argtypes.
Parameters
$signature | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:173
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:221
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:84
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregates() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:178
Calls 3
- static-call ImplementationGap::production() line 163
- new AggregateSignature line 166
- method-call SignatureRule::aggregateArguments() line 166
public function aggregates(Node $list): list<AggregateSignature>Lowers aggregate_with_argtypes_list.
Parameters
$list | Node |
Returns
list<AggregateSignature>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:92
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:94
Calls 2
- method-call Lowering::items() line 177
- method-call SignatureRule::aggregate() line 178
public function aggregateArguments(Node $arguments): AggregateArgumentsLowers aggr_args.
Parameters
$arguments | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DefineRule::define() packages/sql-semantics-postgres/src/Lowering/Routine/DefineRule.php:76
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregate() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:166
Calls 3
- new AggregateArguments line 194
- method-call SignatureRule::aggregateList() line 195
- static-call ImplementationGap::production() line 198
public function aggregateList(Node $list): list<FunctionParameter>Lowers aggr_args_list.
Parameters
$list | Node |
Returns
list<FunctionParameter>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregateArguments() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:195
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregateArguments() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:196
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::aggregateArguments() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:197
Calls 3
- method-call Lowering::items() line 212
- static-call ImplementationGap::production() line 215
- method-call SignatureRule::parameter() line 217
public function operator(Node $signature): OperatorSignatureLowers operator_with_argtypes.
Parameters
$signature | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 6
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::operator() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:197
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:222
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:85
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:118
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:102
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\SignatureRule::operators() packages/sql-semantics-postgres/src/Lowering/Routine/SignatureRule.php:256
Calls 6
- static-call ImplementationGap::production() line 232
- new OperatorSignature line 239
- class-const OperatorArity::Incomplete() line 239
- class-const OperatorArity::Binary() line 240
- class-const OperatorArity::Prefix() line 241
- class-const OperatorArity::Postfix() line 242
public function operators(Node $list): list<OperatorSignature>Lowers operator_with_argtypes_list.
Parameters
$list | Node |
Returns
list<OperatorSignature>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:93
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:112
Calls 2
- method-call Lowering::items() line 255
- method-call SignatureRule::operator() line 256
Private surface 2§
Implementation details, listed for orientation only.
private const MODES = ['arg_class: IN_P' => \SqlSemantics\Platform\PostgreSql\Statement\Routine\Param…private Lowering $loweringTest cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 12
SignatureRuleTest::testAggregateArgumentsLowersOrderedSetscallsSignatureRuleTest::testAggregateListLowersTheArgumentscallsSignatureRuleTest::testAggregateLowersNameAndArgumentscallsSignatureRuleTest::testAggregatesLowersTheListcallsSignatureRuleTest::testArgumentsLowersAnEmptyListcallsSignatureRuleTest::testFunctionLowersEachFormcallsSignatureRuleTest::testFunctionRejectsAnotherNonterminalcallsSignatureRuleTest::testFunctionsLowersTheListcallsSignatureRuleTest::testModeKeepsTheSpellingOfInOutcallsSignatureRuleTest::testOperatorKeepsHowTheTypesAreWrittencallsSignatureRuleTest::testOperatorsLowersTheListcallsSignatureRuleTest::testParameterKeepsTheOrderOfNameAndModecalls
Relations§
Instantiated in 15
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\DefineRule::define() packages/sql-semantics-postgres/src/Lowering/Routine/DefineRule.php:76
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:88
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:99
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:165
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::operator() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:197
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:211
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:85
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:114
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OptionRule::alter() packages/sql-semantics-postgres/src/Lowering/Routine/OptionRule.php:207
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:66
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:76
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:84
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:94
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:102
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:112
Method calls 24
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DefineRule::define() packages/sql-semantics-postgres/src/Lowering/Routine/DefineRule.php:76
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:92
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:93
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::signed() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:95
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:102
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:103
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\FunctionRule::parameter() packages/sql-semantics-postgres/src/Lowering/Routine/FunctionRule.php:104
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:173
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:174
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::operator() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:197
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:220
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:221
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:222
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:85
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:118
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:119
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:120
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OptionRule::alter() packages/sql-semantics-postgres/src/Lowering/Routine/OptionRule.php:207
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:66
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::functionSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:76
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:84
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::aggregateSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:94
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignature() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:102
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::operatorSignatures() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:112