Skip to content

Can't satisfy Squiz.Arrays.ArrayDeclaration.ValueNoNewline with callable value #3112

@simPod

Description

@simPod

Describe the bug
Can't satisfy sniff when callable is within multiline array

Code sample

$a = [
    static function (): void {
    },
];

Each value in a multi-line array must be on a new line

The value is on a new line.

This can't be done either because of Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore

$a = [
    static function (): void {},
];

Closing brace must be on a line by itself

Versions (please complete the following information):

  • OS: [MacOS 10.15]
  • PHP: [e.g., 7.2, 7.4]
  • PHPCS: [e.g., 3.5.5, master]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions