
trailing_comma_in_multiline_array
¶PHP multi-line arrays should have a trailing comma.
after_heredoc
¶Whether a trailing comma should also be placed after heredoc end.
Allowed types: bool
Default value: false
With configuration: ['after_heredoc' => true]
.
--- Original
+++ New
<?php
$x = [
'foo',
<<<EOD
bar
- EOD
+ EOD,
];
The rule is part of the following rule sets:
Using the @PHP73Migration rule set will enable the trailing_comma_in_multiline_array
rule with the config below:
['after_heredoc' => true]
Using the @PHP74Migration rule set will enable the trailing_comma_in_multiline_array
rule with the config below:
['after_heredoc' => true]
Using the @PHP80Migration rule set will enable the trailing_comma_in_multiline_array
rule with the config below:
['after_heredoc' => true]
Using the @PhpCsFixer rule set will enable the trailing_comma_in_multiline_array
rule with the default config.
Using the @Symfony rule set will enable the trailing_comma_in_multiline_array
rule with the default config.