Skip to content

Commit

Permalink
minor #47 Operators - when multiline - must always be at the end of t…
Browse files Browse the repository at this point in the history
…he line (coldic3)

This PR was merged into the 4.0-dev branch.

Discussion
----------

Regarding Sylius/Sylius#13928 (comment)

Commits
-------

79ad35f Operators - when multiline - must always be at the end of the line
  • Loading branch information
Zales0123 authored Jun 15, 2022
2 parents a1d2381 + 79ad35f commit 242bc62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
use PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer;
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
use PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer;
use PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer;
Expand Down Expand Up @@ -328,6 +329,11 @@

$services->set(UnaryOperatorSpacesFixer::class);

$services
->set(OperatorLinebreakFixer::class)
->call('configure', [['only_booleans' => true, 'position' => 'end']])
;

$services->set(NoBlankLinesAfterPhpdocFixer::class);

$services->set(NoEmptyPhpdocFixer::class);
Expand Down
8 changes: 8 additions & 0 deletions tests/FooBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ public function setBar(string $bar): self

return $this;
}

public function isBaz(): bool
{
return
str_contains($this->foo, 'baz') &&
str_contains($this->bar, 'baz')
;
}
}

0 comments on commit 242bc62

Please sign in to comment.