Rule no_whitespace_in_empty_array¶
Empty arrays should not contain only whitespace.
Examples¶
Example #1¶
--- Original
+++ New
<?php
-$foo = [
-];
+$foo = [];
Rule sets¶
The rule is part of the following rule set:
References¶
Fixer class: PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceInEmptyArrayFixer
Test class: PhpCsFixer\Tests\Fixer\ArrayNotation\NoWhitespaceInEmptyArrayFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.