Skip to content

Squiz ArrayDeclaration incorrectly fixes multi-line array where end bracket is not on a new line #1028

@gsherwood

Description

@gsherwood

This code

$fields = [ 'id' => ['type' => 'INT'], 'value' => ['type' => 'VARCHAR']]; $fields = array( 'id' => array('type' => 'INT'), 'value' => array('type' => 'VARCHAR'));

is fixed like this (notice the comma at the end of each array, causing a syntax error)

 $fields = [ 'id' => ['type' => 'INT'], 'value' => ['type' => 'VARCHAR'], ];, $fields = array( 'id' => array('type' => 'INT'), 'value' => array('type' => 'VARCHAR'), );,

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