-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
unary_operator_spaces included in PSR-12 and PER-CS #7504
Comments
It was already reported in #7388 (where the rule was added to the PSR-12 ruleset), and discussed in #7303 - please look at this comment. I am going to close this is as this is not a bug, but expected behavior. If you feel that |
Where in this section does it follow that it should be expected behavior to have a space removed from anything other than increment/decrement or type casting operators? https://www.php-fig.org/psr/psr-12/#61-unary-operators You guys keep insisting that PSR-12 says that this space rule applies to all unary operators, even-though the documentation never states this. My other comment pointing out this fact was always conveniently ignored. |
Let me start by saying I always assume good intentions and I'm thankful for all the effort that goes into any package 😘 The frustration one might have tasted in my earlier comments, stems from the fact that I strongly disagree with the opinion that removing spaces surrounding ALL unary operators should be the expected behavior when dealing with the default PSR-12 ruleset. Can someone explain to me why it should be expected behavior - and subsequently where my reasoning is flawed - if the following is true:
From this it would follow, that one should expect that a statement like |
@wimski you had discussion with @keradus who provided his perspective on the matter, and I just act with that in mind 🙂. @keradus is the project's leader, I only follow directions. Maybe I was not clear enough, I meant the current behaviour is expected in terms of @keradus' approach, because it was him who added |
@Wirone thanks for taking the time to respond.
Then my assumption of thinking those two things should be the same were clearly the flaw in my reasoning 🙈
Good to know I'm not completely mad 😉 I'll plan that discussion then to argue (in general) that a PSR-12 ruleset should follow the PSR-12 definition. |
Bug report
Description
The rule
unary_operator_spaces
rule is included in the rulesets PSR-12 and PER-CS, and it also removes spaces between the not operator and proceeding statement. From what I can understand, reading the specs, the not operator has no enforced rule regarding it. The spec says this regarding operators:And only mentions rules for increment/decrement and type casting when it comes to unary operators. So from my understanding this means that this shouldn't affect the not operator. Am I understanding it correctly? Is there a way to override that specific behavior if one should wish so?
Runtime version
Code snippet that reproduces the problem
The text was updated successfully, but these errors were encountered: