Operators - when multiline - must always be at the beginning or at the end of the line.
Whether to limit operators to only boolean ones.
Allowed types: bool
Default value: false
Whether to place operators at the beginning or at the end of the line.
Allowed values: 'beginning'
and 'end'
Default value: 'beginning'
Default configuration.
--- Original
+++ New
<?php
function foo() {
- return $bar ||
- $baz;
+ return $bar
+ || $baz;
}
With configuration: ['position' => 'end']
.
--- Original
+++ New
<?php
function foo() {
- return $bar
- || $baz;
+ return $bar ||
+ $baz;
}
The rule is part of the following rule sets:
@PhpCsFixer with config:
['only_booleans' => true]
@Symfony with config:
['only_booleans' => true]
- Fixer class: PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer
- Test class: PhpCsFixer\Tests\Fixer\Operator\OperatorLinebreakFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.