final class Parameter
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One parameter of a stored procedure or function: its optional direction, its name and its type.

Only a procedure parameter has a direction; a parameter without one is an IN parameter. Source: https://dev.mysql.com/doc/refman/8.4/en/create-procedure.html.

Reading a parameterdoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE PROCEDURE p(INOUT total DECIMAL(10, 2)) BEGIN END');
    $parameter = $create->statement->parameters->parameters[0];
    [$parameter->mode, $parameter->name->value, $parameter->type->name()] // => [\SqlSemantics\Platform\MySql\Statement\Routine\ParameterMode::InOut, 'total', 'DECIMAL']

Properties§

public Name $name
public TypeName $type
public CollationName|null $collation = null
public ParameterMode|null $mode = null

Methods§

public function __construct(
    public Name $name,
    public TypeName $type,
    public CollationName|null $collation = null,
    public ParameterMode|null $mode = null,
)

Parameters

$nameNameThe parameter name
$typeTypeNameThe declared type
$collationCollationName|nullThe COLLATE clause of the type
$modeParameterMode|nullThe direction keyword, when written
public function render(Output $out): void

Writes the direction, the name and the type.

Parameters

$outOutput
Test cases 1
Calls 5

Test cases 12§

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 10

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1