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
Fixes parenthesis when \n is involved #8453
Conversation
I guess there is the same issue with tabulations, right? |
I don't know. Who uses tabs on queries anyways? EDIT: Just tried it out, my IDE converts automatically tabs to multiple spaces.. |
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.
Yeah, but maybe str_replace is faster. If we will use RegEx, I can just use preg_match and not replace anything.
Probably, but here I don't think we are in the hot path: we are in dql parsing which:
- is cached
- does not happen a lot (a few queries vs other code that applies on every row of the result set)
I think it's not the actual flow. This is QueryBuilder, which builds DQL which is then parsed and after that cached. But yeah, 30-40 preg_matches more (how many QB can have a single page?) - won't be anything significant. |
Hmmm yes I think you're right, it's probably executed every time indeed 👍 |
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.
The pattern is not a expensive one. I think this should be fine.
Thanks @Warxcell ! I squashed your commits because the first one and the last one really should, and although you made an argument for squashing in another PR, in this case it's unlikely to apply. |
when we have OR like that (without space before OR) - it doesn't add parenthesis.