-
- Notifications
You must be signed in to change notification settings - Fork 89
Closed
Milestone
Description
Describe the bug
Doesn't properly detect the correct number of space in some cases.
Code sample
<?php declare(strict_types=1); namespace a; class Hello { /** @param mixed[] $items */ public static function world(array $items, bool $nice): void { } public function hi(): void { \a\Hello::world( items: [ 'a' => [1, 2, 3] ], nice: false ); } }
If I add a comma after "nice: false", no error is reported
Custom ruleset
<?xml version="1.0"?> <ruleset name="My Custom Standard"> <description>If you are using a custom ruleset, please enter the relevant part here.</description> </ruleset>
To reproduce
Steps to reproduce the behavior:
- Create a file called
test.php
with the code sample above... - Run
phpcs test.php ...
- See error message displayed
21 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found 8 (Generic.WhiteSpace.ScopeIndent.Incorrect)
Expected behavior
No error
Versions (please complete the following information)
Operating System | Windows 10 |
PHP version | 8.1 |
PHP_CodeSniffer version | 3.10.0 |
Standard | psr12 |
Install type | [composer |
Additional context
Add any other context about the problem here.
Please confirm
- I have searched the issue list and am not opening a duplicate issue.
- I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
- I have verified the issue still exists in the
master
branch of PHP_CodeSniffer.