Skip to content

False Positive: Squiz.Arrays.ArrayDeclaration.ValueNoNewline #3952

@simPod

Description

@simPod

Describe the bug

Squiz.Arrays.ArrayDeclaration.ValueNoNewline gives false positives

Code sample

$x = [
    static fn (  // false positive here
        A $a,
    ) => B::create(
        $a,
    ),
    false,
];

$y = [
    ...[ // false positive here
        new A(),
    ],
];

To reproduce

Steps to reproduce the behavior:

  1. Create a file called test.php with the code sample above...
  2. Run phpcs test.php ...
  3. See error message displayed
PHPCS output here

Expected behavior

No rrror

Versions (please complete the following information)

Operating System [MacOS]
PHP version [8.3]
PHP_CodeSniffer version [3.7.2]
Standard [Squiz]
Install type [composer local]

Please confirm:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions