coder-format doesn't like empty multi-line arrays like this:

  $item = array(
    'key' => array(
    ),
    'another' => 1,
  );

It will add an unwanted comma at the end of the second line, which is not valid syntax and produces a compile-time error.

Attached patch makes sure we're never inserting commas at the beginning of an array.

CommentFileSizeAuthor
coder-format-empty-arrays.patch705 bytesmatt2000
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matt2000’s picture

Issue summary: View changes

minor typo fix

klausi’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Coder format is frozen and will not receive updates. Please use the phpcbf command with Coder 8.x-2.x instead. It can be used to format code for any Drupal version.