classParameterRule
final class ParameterRule
Lowers the parameter lists of stored routines and the data types of parameters, variables and return values.
Rule: MYSQL-ROUTINE-PARAMETER-LOWERING-001. Scope: sp_fdparam_list, sp_fdparams, sp_fdparam, sp_pdparam_list, sp_pdparams, sp_pdparam, sp_opt_inout, type_with_opt_collate. The type comes from the type rules, the collation from the leaf rules. Constructs: ParameterList, Parameter. Terminates: the lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/create-procedure.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function parameters(Node $list): ParameterListLowers a parameter list: a node of sp_fdparam_list or sp_pdparam_list.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:127
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:131
Calls 7
- method-call Lowering::form() line 57
- method-call Sequence::items() line 61
- new Sequence line 61
- class-const ParameterRule::LISTS() line 61
- static-call ImplementationGap::production() line 62
- method-call ParameterRule::parameter() line 65
- new ParameterList line 68
Lowers one parameter: a node of sp_fdparam or sp_pdparam.
Parameters
$parameter | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 6
- method-call Lowering::form() line 78
- static-call ImplementationGap::production() line 84
- function-call
array_key_existsline 92 - class-const ParameterRule::MODES() line 92
- method-call ParameterRule::declared() line 97
- new Parameter line 99
public function declared(Node $type, ?Node $collation): array{TypeName, CollationName|null}Lowers a data type with its optional COLLATE clause: a node of type_with_opt_collate, or a node
of type and the node of opt_collate that follows it.
Returns
array{TypeName, CollationName|null}Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:129
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\ParameterRule::parameter() packages/sql-semantics-mysql/src/Lowering/Routine/ParameterRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:99
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:103
Calls 2
- method-call Lowering::form() line 112
- static-call ImplementationGap::production() line 114
Private surface 3§
Implementation details, listed for orientation only.
private const MODES = ['sp_opt_inout:' => null, 'sp_opt_inout: IN_SYM' => \SqlSemantics\Platform\MySq…private const LISTS = ['sp_fdparams: sp_fdparams , sp_fdparam', 'sp_fdparams: sp_fdparam', 'sp_pdpara…private Lowering $loweringTest cases 3§
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\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:127
- new SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:129
- new SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:131
- new SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:96
Method calls 5
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:127
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:129
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\DefinitionRule::routine() packages/sql-semantics-mysql/src/Lowering/Routine/DefinitionRule.php:131
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:99
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:103