Skip to content

Fix sniff which requires each line of multi-line arrays to end in commas #16

@westonruter

Description

@westonruter

It doesn't work so well if you have comments or function calls appearing in the array.

<?php
$foo = array(
    'bar' => array_merge(
        array(
            'x' => 1,
        ),
        array(
            'y' => 2,
        )
    ),
    'baz' => function () {
        echo 'Jello World';
    },
);
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
  3 | ERROR | Each line in an array declaration must end in a comma
 11 | ERROR | Each line in an array declaration must end in a comma
--------------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions