classCallArgument
final class CallArgument
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One argument of a call written as name(...), with the alias a loadable function receives as the name of the argument.
Without an alias a loadable function sees the text of the argument as its name; native functions reject an alias. The call that holds the argument derives its expression. Source: https://dev.mysql.com/doc/refman/8.4/en/udf-arguments.html.
$argument = new \SqlSemantics\Platform\MySql\Statement\Call\CallArgument(new \SqlSemantics\Platform\MySql\Statement\Name\ColumnUse(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('a')), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('total'));
[$argument->expression->name->value, $argument->alias?->value] // => ['a', 'total']Properties§
public Scalar $expressionpublic Name|null $alias = nullpublic AliasMark $mark = AliasMark::AsMethods§
public function __construct(
public Scalar $expression,
public Name|null $alias = null,
public AliasMark $mark = AliasMark::As,
)Parameters
Throws
InvalidConstruction When the mark does not fit the aliasCalls 3
- class-const AliasMark::As() line 39
- static-call Check::input() line 41
- class-const AliasMark::Equals() line 41
public function render(Output $out): voidWrites the expression and its alias.
Parameters
$out | Output |
Test cases 1
Calls 4
- method-call Output::node() line 49
- method-call AliasMark::write() line 51
- method-call Output::name() line 52
- class-const NameUse::Alias() line 52
Test cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 8
RoutineCallsTest::testResultReportsWhatTheServerRejectscallsRoutineCallsTest::testResultTypesANativeFunctioncallsItemNamingTest::testCanonicalAnswersTheRenderedTextcallsItemNamingTest::testConstantSpellsTheNameArgumentOfNameConstcallsFunctionCallTest::testDeriveScalarDependsOnAStoredFunctioncallsFunctionCallTest::testDeriveScalarTypesANativeFunctioncallsFunctionCallTest::testNamedTellsWhetherAnArgumentHasAnAliascallsFunctionCallTest::testRenderGluesTheNameToItsParenthesiscalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Call\FunctionRule::call() packages/sql-semantics-mysql/src/Lowering/Call/FunctionRule.php:172
- new SqlSemantics\Platform\MySql\Lowering\Call\FunctionRule::argument() packages/sql-semantics-mysql/src/Lowering/Call/FunctionRule.php:251
- new SqlSemantics\Platform\MySql\Lowering\Call\FunctionRule::argument() packages/sql-semantics-mysql/src/Lowering/Call/FunctionRule.php:257