-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PSR12: Support multiple lines control structure spacing sniffs #2113
Comments
Just a note in case you are trying to use the PSR-12 standard and not just test it: the included PSR-12 standard is not complete (I released it as a preview) and I'm unable to complete it due to the inconsistencies in the PSR-12 spec itself. Since PSR-12 is now back in draft, I'm not going to spend a lot of time on it until a few things start to change. But this one is a pretty clear change from PSR-2 and is failing because I just used the PSR-2 sniff to cover a bunch of cases. This needs to be fixed up, probably by refactoring and extending the PSR-2 sniff. |
Since <?php
for (
$i = 0;
$i < 10;
$i++
) {
// for body
}
|
Now that PSR-12 has been ratified, any timeline on when this issue will be fixed? |
No, I can't provide a time. |
What's your opinion about this solution scheb@73a6ccf ? It would allow PSR2 standard to behave as before, but allow newlines within PSR12. I did not change all the sniffs yet, because I wanted to get some opinions first. The principle would be the same for others such as Besides that, I don't understand how to write a test case for a sniff with certain properties set. Maybe someone be so kind to point me to an example. |
Can't see any other test using properties, but i guess you can write directly to
Or just load the PSR12
|
@scheb Use |
I've just noticed this is still open, but the newline issue has already been resolved in the PSR12 standard for 3.5.0 and this should have been closed then. The solution was to write a new sniff for PSR12. |
Following the PSR12 :
The current PSR12 ruleset will show the following error code :
PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace
The expected behavior is that no error is shown for the example code.
The text was updated successfully, but these errors were encountered: