-
Notifications
You must be signed in to change notification settings - Fork 821
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
PHP Formatting: No space between 'AND !$var'. #4635
Milestone
Comments
NotherGithubAccount
added
kind:bug
Bug report or fix
needs:triage
Requires attention from one of the committers
labels
Sep 14, 2022
Reproducible. Thanks! |
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Oct 6, 2022
…che#4635 - `WHITESPACE_BEFORE_BINARY_OP` and `WHITESPACE_AFTER_BINARY_OP` are added to `&&` and `||` - There is the problem if we add them to `AND`, `OR`, and `XOR` - See: https://bz.apache.org/netbeans/show_bug.cgi?id=240274 - e.g. if they are false, `copy($old,$new) or die("error");` -> `copy($old,$new) ordie("error");` - Instead, add always `WHITESPACE_AROUND_TEXTUAL_OP` as a new token
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Oct 6, 2022
…che#4635 - `WHITESPACE_BEFORE_BINARY_OP` and `WHITESPACE_AFTER_BINARY_OP` are added to `&&` and `||` - There is the problem if we add them to `AND`, `OR`, and `XOR` - See: https://bz.apache.org/netbeans/show_bug.cgi?id=240274 - e.g. if they are false, `copy($old,$new) or die("error");` -> `copy($old,$new) ordie("error");` - Instead, add `WHITESPACE_AROUND_TEXTUAL_OP` as a new token
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Oct 6, 2022
…he#4635 - `WHITESPACE_BEFORE_BINARY_OP` and `WHITESPACE_AFTER_BINARY_OP` are added to `&&` and `||` - There is the problem if we add them to `AND`, `OR`, and `XOR` - See: https://bz.apache.org/netbeans/show_bug.cgi?id=240274 - e.g. if they are false, `copy($old,$new) or die("error");` -> `copy($old,$new) ordie("error");` - Instead, add `WHITESPACE_AROUND_TEXTUAL_OP` as a new token
tmysik
added a commit
that referenced
this issue
Oct 7, 2022
…l-operators Fix the formatting for the textual operators(`AND`, `OR`, `XOR`) #4635
Thanks for the quick fix! |
You are welcome :) |
Chris2011
pushed a commit
to Chris2011/netbeans
that referenced
this issue
Dec 15, 2022
…he#4635 - `WHITESPACE_BEFORE_BINARY_OP` and `WHITESPACE_AFTER_BINARY_OP` are added to `&&` and `||` - There is the problem if we add them to `AND`, `OR`, and `XOR` - See: https://bz.apache.org/netbeans/show_bug.cgi?id=240274 - e.g. if they are false, `copy($old,$new) or die("error");` -> `copy($old,$new) ordie("error");` - Instead, add `WHITESPACE_AROUND_TEXTUAL_OP` as a new token
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache NetBeans version
Apache NetBeans 15 release candidate
What happened
if ($a AND !$b)
formats toif ($a AND!$b)
. It works correctly with &&, the behavior is the same with OR and ||.When checking the "Unary Operator" box in Tools -> Options -> Editor -> Formatting for PHP and spaces, the result is
($a AND ! $b)
While that works as advertised, imho there should always be a space after AND/OR.
How to reproduce
Create corresponding test code and select source->format.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Debian 11 5.18.0-0.deb11.4-amd64
JDK
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
Afaik, always.
Are you willing to submit a pull request?
No
Code of Conduct
Yes
The text was updated successfully, but these errors were encountered: