Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
coder-format-empty-arrays.patch | 705 bytes | matt2000 |
Comments
Comment #0.0
matt2000 CreditAttribution: matt2000 commentedminor typo fix
Comment #1
klausiCoder 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.