You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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 Generic.WhiteSpace.ScopeIndent and the Squiz.WhiteSpace.ScopeClosingBrace sniffs.
I've ran into that one a number of times before, but haven't been able to find the time to debug it properly .
gsherwood
changed the title
PHPCBF Failed to fix when there is space before php openning tag
Fixer conflict between Generic.WhiteSpace.ScopeIndent and Squiz.WhiteSpace.ScopeClosingBrace when class indented 1 space
Apr 1, 2019
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.
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: