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
Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
$ ./vendor/bin/phpcs ./packages/Bug.php
FILE: /project/packages/Bug.php
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 5 spaces but found 8 spaces
8 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 4 spaces
15 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 7 spaces but found 8 spaces
16 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------
Time: 119ms; Memory: 8MB
Expected behavior
No warnings.
Versions (please complete the following information):
OS: [e.g., Windows 10, MacOS 10.15]: Ubuntu Latest
PHP: [e.g., 7.2, 7.4]: 8.0
PHPCS: [e.g., 3.5.5, master]: master
Standard: [e.g., PSR2, PSR12, Squiz]: none
The text was updated successfully, but these errors were encountered:
I've done some debugging and this is happening because of those empty lines containing just comments. The sniff is seeing those as having no code on them, so it looks like a break in the assignment block.
gsherwood
changed the title
False positive Generic.Formatting.MultipleStatementAlignment.IncorrectWarning: Equals sign not aligned correctly for anonymous classes and closures
Generic.Formatting.MultipleStatementAlignment false positive for empty anonymous classes and closures
Feb 14, 2021
Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No warnings.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: