Open
Description
Describe the bug
Squiz.Arrays.ArrayDeclaration.ValueNoNewline
triggers false positive at static fn
.
Code sample
return [
static fn (string $value): AAA => new AAA($value),
BBB::fromString(...),
];
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
PHPCS output here
Expected behavior
No error
Versions (please complete the following information)
Operating System | macos 14 |
PHP version | 8.3 |
PHP_CodeSniffer version | 3.10.1 |
Standard | Squiz |
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 have read the Contribution Guidelines and this is not a support question.
- 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.