Closed scorgn closed 1 year ago
Closing as duplicate of #3477 and #3707, which were both already fixed via #3805.
@scorgn I don't know why you checked the "I have verified the issue still exists in the master branch of PHP_CodeSniffer." (or the "I have searched the issue list and am not opening a duplicate issue.") checkboxes ? Any particular reason ? I honestly cannot reproduce the issue anymore with the current master
branch, so I don't understand how you could... ?
Apologies, I'm now realizing that my .zshrc kicked in and was still using the global installation of phpcs rather than the one in the local folder.
I did search through existing issues but I wasn't able to find those, I will try to be more diligent looking in the future.
@scorgn Thanks for getting back to me. The fix will be included in the next (3.8.0) release.
Describe the bug
phpcbf fails to fix a file when it has a call to a function where all the following are true:
The two conflicting rules are:
Code samples
phpcbf will fail to fix the following code samples:
However phpcbf will successfully fix the following code sample without failing:
To reproduce
Steps to reproduce the behavior:
test.php
with any of the failing code samples above...phpcbf --standard=PSR2 --sniffs=Generic.Functions.FunctionCallArgumentSpacing,PSR2.Methods.FunctionCallSignature test.php
Expected behavior
It may not be appropriate for phpcs to remove the trailing comma, so my expected behavior would be that phpcs does not mark the line as automatically fixable and that phpcbf does not attempt to fix the issue - and that phpcbf does not fail to fix the file.
Versions (please complete the following information)
Please confirm:
master
branch of PHP_CodeSniffer.