Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
-------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------
12 | ERROR | [x] Array double arrow not aligned correctly; expected 1 space but found 2
13 | ERROR | [x] Array double arrow not aligned correctly; expected 4 spaces but found 13
19 | ERROR | [x] Array double arrow not aligned correctly; expected 1 space but found 13
20 | ERROR | [x] Array double arrow not aligned correctly; expected 1 space but found 13
28 | ERROR | [x] Array double arrow not aligned correctly; expected 1 space but found 17
29 | ERROR | [x] Array double arrow not aligned correctly; expected 1 space but found 17
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
Expected behavior
No error.
Versions (please complete the following information)
Operating System
Windows 10
PHP version
8.3
PHP_CodeSniffer version
3.9.2
Standard
custom
Install type
composer
Please confirm
[x] I have searched the issue list and am not opening a duplicate issue.
[x] I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
[x] I have verified the issue still exists in the master branch of PHP_CodeSniffer.
Describe the bug
Calculation of the align seems incorrect inside
match
.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error.
Versions (please complete the following information)
Please confirm
master
branch of PHP_CodeSniffer.