
Rule no_spaces_around_offset
ΒΆ
There MUST NOT be spaces around offset braces.
ConfigurationΒΆ
positions
ΒΆ
Whether spacing should be fixed inside and/or outside the offset braces.
Allowed values: a subset of ['inside', 'outside']
Default value: ['inside', 'outside']
ExamplesΒΆ
Example #1ΒΆ
Default configuration.
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b['a']['b'];
Example #2ΒΆ
With configuration: ['positions' => ['inside']]
.
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b ['a'] ['b'];
Example #3ΒΆ
With configuration: ['positions' => ['outside']]
.
--- Original
+++ New
<?php
-$sample = $b [ 'a' ] [ 'b' ];
+$sample = $b[ 'a' ][ 'b' ];
Rule setsΒΆ
The rule is part of the following rule sets: