We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
phpcs in PSR12 mode reports that a line is indented incorrectly when it is correctly indented according to my understanding.
Code sample
<?php namespace foo; class Foo { public static function foo(array $foo): array { return \array_map(static function ($foo) { return [ match ($foo) { 0 => 1, 1 => 0, }, $foo, ]; }, $foo); } }
Custom ruleset
--standard=PSR12
To reproduce
Steps to reproduce the behavior:
test.php
phpcs --standard=PSR12 -s test.php
FILE: /pwd/test.php -------------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------------- 11 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 16 | | (Generic.WhiteSpace.ScopeIndent.IncorrectExact) 14 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 16 | | (Generic.WhiteSpace.ScopeIndent.IncorrectExact) -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- Time: 73ms; Memory: 8MB
When reformatting with phpcbf the file will look like this afterwards:
phpcbf
Expected behavior
I did not expect any errors in the given file.
I expected phpcbf not to change the file.
Versions (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Looks to be something wrong going on here; possibly a conflict between ignoring exact indents and fixed indents for control structures.
Smallest sample code to replicate:
foo(function ($foo) { return [ match ($foo) { } ]; });
Sorry, something went wrong.
Fixed bug #3672 : Incorrect ScopeIndent.IncorrectExact report for mat…
f1d1a68
…ch inside array literal
d7864cb
I've pushed a fix for this issue, which will be in the 3.7.2 release. Thanks for the bug report.
Language*Form
No branches or pull requests
Describe the bug
phpcs in PSR12 mode reports that a line is indented incorrectly when it is correctly indented according to my understanding.
Code sample
Custom ruleset
--standard=PSR12
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs --standard=PSR12 -s test.php
When reformatting with
phpcbf
the file will look like this afterwards:Expected behavior
I did not expect any errors in the given file.
I expected phpcbf not to change the file.
Versions (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: