
Rule no_whitespace_before_comma_in_array
ΒΆ
In array declaration, there MUST NOT be a whitespace before each comma.
ConfigurationΒΆ
after_heredoc
ΒΆ
Whether the whitespace between heredoc end and comma should be removed.
Allowed types: bool
Default value: false
ExamplesΒΆ
Example #1ΒΆ
Default configuration.
--- Original
+++ New
-<?php $x = array(1 , "2");
+<?php $x = array(1, "2");
Example #2ΒΆ
With configuration: ['after_heredoc' => true]
.
--- Original
+++ New
<?php
$x = [<<<EOD
foo
-EOD
- , 'bar'
+EOD, 'bar'
];
Rule setsΒΆ
The rule is part of the following rule sets:
@PHP73Migration with config:
['after_heredoc' => true]
@PHP74Migration with config:
['after_heredoc' => true]
@PHP80Migration with config:
['after_heredoc' => true]
@PHP81Migration with config:
['after_heredoc' => true]
@PHP82Migration with config:
['after_heredoc' => true]
@PHP83Migration with config:
['after_heredoc' => true]
Source classΒΆ
PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer