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
Describe the bug
When comma is used after last argument in call, following sniffs report an issue and fail to fix it. It is caused by these sniffs colliding with each other.
Create a file called test.php with the code sample above...
Run phpcbf 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
Fixes the error without failure.
I believe it could be fixed in Generic.Functions.FunctionCallArgumentSpacing by allowing no space after comma, when comma is followed by right parenthesis. - call($arg,) should be okay.
The comma itself can be removed by SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall sniff.
Versions:
OS: Windows 10 - WSL 2.0
PHP: 8.0.15
PHPCS: 3.6.2
Standard: custom
The text was updated successfully, but these errors were encountered:
Describe the bug
When comma is used after last argument in call, following sniffs report an issue and fail to fix it. It is caused by these sniffs colliding with each other.
Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcbf test.php ...
Expected behavior
Fixes the error without failure.
I believe it could be fixed in
Generic.Functions.FunctionCallArgumentSpacing
by allowing no space after comma, when comma is followed by right parenthesis. -call($arg,)
should be okay.The comma itself can be removed by
SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall
sniff.Versions:
The text was updated successfully, but these errors were encountered: