-
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
Fixer conflict between Generic.WhiteSpace.ScopeIndent and Squiz.WhiteSpace.ScopeClosingBrace when class indented 1 space #2464
Comments
@mirzazeyrek Thanks for reporting this, though I think the topic needs to be changed. There is no rule in PSR-2 about space before the PHP open tag not being allowed, so PHPCS is not trying to fix that at all, nor will it report on it. The fixer conflict you are seeing is a conflict between the I've ran into that one a number of times before, but haven't been able to find the time to debug it properly . |
A possible solution for this is to just let scope closers (like the class closing brace) be indented to a column that isn't divisible by the current tab width. This change stops the conflict from occurring and it doesn't make any of the scope indent unit tests fail, but need to add some more tests just to be sure. |
…nt and Squiz.WhiteSpace.ScopeClosingBrace when class indented 1 space
I checked the history of this code and it's been around forever, but an exception was made for closures about 5 years ago. None of the tests are failing, so I've made the change, which allows the closing brace to sit wherever the opener does and not have to be a perfect index. This lets other parts of a standard enforce closing brace rules. |
This update comes with a few indent changes (see [0]). The update is needed to pull the most recent UnusedUses sniff from slevomat/coding-standards into our codebase. Part of request #13708: Cleanup unused use statements and enforce it in the Tuleap PHP coding standards [0] squizlabs/PHP_CodeSniffer#2464 Change-Id: I9136142542d0aa83bccc41d62f03b4317e0367cd
PHPCS version:
PHP_CodeSniffer version 3.4.1 (stable) by Squiz (http://www.squiz.net)
Command:
phpcbf --standard=PSR2 calculator.php -p
File:
The text was updated successfully, but these errors were encountered: