PEAR/ScopeClosingBrace: fix fixer conflict #1813
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another small PR to fix a fixer conflict between the
PEAR.WhiteSpace.ScopeClosingBrace
and thePEAR.WhiteSpace.ScopeIndent
(extended fromGeneric.WhiteSpace.ScopeIndent
) sniffs.If a
case
ordefault
statement uses braces, the scope indent and scope closing brace sniffs would fight over where the brace should be placed.The unit test file already contains a test case highlighting the issue.
PHP_CodeSniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc
Lines 88 to 90 in b55fd82
To reproduce the issue, run the following command on the
master
branch:phpcbf -p -s -vv ./src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc --standard=PEAR
Note: this change does change the behaviour of the sniff in that particular case. If that's undesired, another solution will need to be found.