-
Notifications
You must be signed in to change notification settings - Fork 143
[CLEANUP] Tidy up DeclarationBlock::parse()
#1294
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
Conversation
- Assign the result of `ParserState::peek()` to a local variable, for efficiency; - Use a switch statement to branch on its value, for extensibility (e.g. #1292); - Don't unnecessarily test that a quote character is not escaped when not within a string.
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.
While we're at it, let's move the changed parts to nullable strings instead of set/not-set variables.
Co-authored-by: Oliver Klee <github@oliverklee.de>
Co-authored-by: Oliver Klee <github@oliverklee.de>
Co-authored-by: Oliver Klee <github@oliverklee.de>
Co-authored-by: Oliver Klee <github@oliverklee.de>
I've accepted all suggestions :) |
The red builds look like some PHIVE install hiccup. I've kicked the pipeline. |
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.
This might also fix a PHPStan warning - so we might need to regenerate the baseline.
It does, but also |
ParserState::peek()
to a local variable, for efficiency;