Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 945 Bytes

trailing_comma_in_multiline_array.rst

File metadata and controls

58 lines (41 loc) · 945 Bytes

Rule trailing_comma_in_multiline_array

Warning

This rule is deprecated and will be removed on next major version.

You should use trailing_comma_in_multiline instead.

PHP multi-line arrays should have a trailing comma.

Configuration

after_heredoc

Whether a trailing comma should also be placed after heredoc end.

Allowed types: bool

Default value: false

Examples

Example #1

Default configuration.

--- Original
+++ New
 <?php
 array(
     1,
-    2
+    2,
 );

Example #2

With configuration: ['after_heredoc' => true].

--- Original
+++ New
 <?php
     $x = [
         'foo',
         <<<EOD
             bar
-            EOD
+            EOD,
     ];