-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix types on walkLiteral()
and walkLikeExpression()
#9566
Conversation
public $stringExpression; | ||
|
||
/** @var InputParameter */ | ||
/** @var InputParameter|FunctionNode|PathExpression|Literal */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are the types we expect here, see:
orm/lib/Doctrine/ORM/Query/SqlWalker.php
Lines 2165 to 2173 in bc6c6c9
if ($likeExpr->stringPattern instanceof AST\InputParameter) { | |
$sql .= $this->walkInputParameter($likeExpr->stringPattern); | |
} elseif ($likeExpr->stringPattern instanceof AST\Functions\FunctionNode) { | |
$sql .= $this->walkFunction($likeExpr->stringPattern); | |
} elseif ($likeExpr->stringPattern instanceof AST\PathExpression) { | |
$sql .= $this->walkPathExpression($likeExpr->stringPattern); | |
} else { | |
$sql .= $this->walkLiteral($likeExpr->stringPattern); | |
} |
@@ -335,7 +335,7 @@ public function walkInstanceOfExpression($instanceOfExpr); | |||
/** | |||
* Walks down a literal that represents an AST node, thereby generating the appropriate SQL. | |||
* | |||
* @param mixed $literal | |||
* @param AST\Literal $literal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing anything else to the implementation in SqlWalker
would cause an error because we access properties on $literal
.
7b3e58d
to
c4180ca
Compare
c4180ca
to
04b7f74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second reviewer should be consulted. Despite that no one mentioned an error before and "smaller" BC breaks were applied in the past in 2.11, this PR can probably be merged after a second review.
* 2.12.x: Deprecate custom ObjectRepository implementations (doctrine#9533) Fix types on walkLiteral() and walkLikeExpression() (doctrine#9566)
No description provided.