-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ExpressionLanguage] throw an SyntaxError instead of an undefined index notice #25323
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
[ExpressionLanguage] throw an SyntaxError instead of an undefined index notice #25323
Conversation
99b4086
to
8822114
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.
Looks good 👍
@@ -56,6 +56,10 @@ public function next() | |||
|
|||
++$this->position; | |||
|
|||
if (!isset($this->tokens[$this->position])) { | |||
throw new SyntaxError('Unexpected end of expression', $this->current->cursor, $this->expression); |
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.
Shouldn't we move the safe guard that was already there? I don't see how the first exception could ever be thrown. It looks to me like this was just mistakenly placed before the pointer is advanced.
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.
done
8822114
to
78abc89
Compare
Thank you @Simperfit. |
…defined index notice (Simperfit) This PR was merged into the 2.7 branch. Discussion ---------- [ExpressionLanguage] throw an SyntaxError instead of an undefined index notice | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #25214 | License | MIT | Doc PR | none I think this is a bug when the components throws a notice instead of an exception. it's too early and too dark to see something outside so here is my couch :  Commits ------- 78abc89 [ExpressionLanguage] throw an SyntaxError instead of letting a undefined index notice
I think this is a bug when the components throws a notice instead of an exception.
it's too early and too dark to see something outside so here is my couch :
