Jan 27, 2023
0
Level 7
PHP-CS-Fixer multiline variable definition
Is there a PHP-CS-Fixer rule which aligns multiline variable definition after the equal sign?
For example, we have this input:
$example = $this->is()->aLong()->definition()->so()->we()->want->()->multilines() +
$this->is()->thesecondline() +
$this->is()->thethirdline() +
Output should be:
$example = $this->is()->aLong()->definition()->so()->we()->want->()->multilines() +
$this->is()->thesecondline() +
$this->is()->thethirdline() +
I'm not sure if there are PSR standards for variable definition or other best-practices how to style this sort of code. In my eyes, it looks way cleaner if it is aligned. I tried to use binary_operator_spaces but it didn't work so far.
Any ideas? Many thanks!
Please or to participate in this conversation.