Skip to content

Commit

Permalink
Changes requested in code review
Browse files Browse the repository at this point in the history
Add NamedScalarExpression to dql reference definition
Revert breaking change in parser
  • Loading branch information
Zuruuh committed Dec 13, 2023
1 parent 60035a0 commit 8d64606
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/en/reference/dql-doctrine-query-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ Select Expressions
PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet
PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}"
NewObjectExpression ::= "NEW" AbstractSchemaName "(" NewObjectArg {"," NewObjectArg}* ")"
NewObjectArg ::= ScalarExpression | "(" Subselect ")"
NewObjectArg ::= ScalarExpression | NamedScalarExpression | "(" Subselect ")"
Conditional Expressions
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 5 additions & 1 deletion lib/Doctrine/ORM/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1948,10 +1948,14 @@ public function NewObjectExpression()
/**
* NewObjectArg ::= ScalarExpression | NamedScalarExpression | "(" Subselect ")"
*
* @param bool $namedArgAlreadyParsed
*
* @return mixed
*/
public function NewObjectArg(bool $namedArgAlreadyParsed = false)
public function NewObjectArg(/* bool $namedArgAlreadyParsed = false */)
{
$namedArgAlreadyParsed = func_get_args()[0] ?? false;

assert($this->lexer->lookahead !== null);
$token = $this->lexer->lookahead;
$peek = $this->lexer->glimpse();
Expand Down

0 comments on commit 8d64606

Please sign in to comment.