Concatenation should be spaced according to configuration.
You can configure this rule using the following option: spacing.
Spacing to apply around concatenation operator.
Allowed values: 'none' and 'one'
Default value: 'none'
Default configuration.
--- Original
+++ New
<?php
-$foo = 'bar' . 3 . 'baz'.'qux';
+$foo = 'bar'. 3 .'baz'.'qux';With configuration: ['spacing' => 'none'].
--- Original
+++ New
<?php
-$foo = 'bar' . 3 . 'baz'.'qux';
+$foo = 'bar'. 3 .'baz'.'qux';With configuration: ['spacing' => 'one'].
--- Original
+++ New
<?php
-$foo = 'bar' . 3 . 'baz'.'qux';
+$foo = 'bar' . 3 . 'baz' . 'qux';The rule is part of the following rule sets:
@PER (deprecated) with config:
['spacing' => 'one']@PER-CS with config:
['spacing' => 'one']@PER-CS2.0 (deprecated) with config:
['spacing' => 'one']@PER-CS2x0 with config:
['spacing' => 'one']@PER-CS3.0 (deprecated) with config:
['spacing' => 'one']@PER-CS3x0 with config:
['spacing' => 'one']
- Fixer class: PhpCsFixer\Fixer\Operator\ConcatSpaceFixer
- Test class: PhpCsFixer\Tests\Fixer\Operator\ConcatSpaceFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.