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
phpcbf will fail to fix the following code samples:
<?phpvar_dump('foobar',);
<?phpvar_dump('foobar'
,
);
<?phpFoo
::bar('foobar',);
<?phpFoo::{
'bar'
}('foobar',);
However phpcbf will successfully fix the following code sample without failing:
<?phpvar_dump
('foobar',);
To reproduce
Steps to reproduce the behavior:
Create a file called test.php with any of the failing code samples above...
Run phpcbf --standard=PSR2 --sniffs=Generic.Functions.FunctionCallArgumentSpacing,PSR2.Methods.FunctionCallSignature test.php
See error message displayed
PHPCBF RESULT SUMMARY
----------------------------------------------------------------------------------------
FILE FIXED REMAINING
----------------------------------------------------------------------------------------
.../test.php FAILED TO FIX
----------------------------------------------------------------------------------------
A TOTAL OF 0 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------------------------
PHPCBF FAILED TO FIX 1 FILE
----------------------------------------------------------------------------------------
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)
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... ?
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.The text was updated successfully, but these errors were encountered: