There MUST NOT be spaces around offset braces.
Whether spacing should be fixed inside and/or outside the offset braces.
Allowed values: a subset of ['inside', 'outside']
Default value: ['inside', 'outside']
Default configuration.
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b['a']['b'];With configuration: ['positions' => ['inside']].
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b ['a'] ['b'];With configuration: ['positions' => ['outside']].
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b[ 'a' ][ 'b' ];The rule is part of the following rule sets:
- Fixer class: PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer
- Test class: PhpCsFixer\Tests\Fixer\Whitespace\NoSpacesAroundOffsetFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.