Open
Description
I'm looking for a rule that enforces newline and spacing in method chaining. When chaining is used and there is a line break anywhere in the chain:
- ALL chained methods should begin on a new line
- with the arrow operator beginning that line
- and each line being indented +1 compared to the first line.
Question:
What combination of rules could I use to achieve this, if any?
Examples:
Allow:
$x = Model::query()->where('x', 1)->where('y', 2)->get();
$x = Model::query()
->where('x', 1)
->where('y', 2)
->get();
Don't allow:
$x = Model::query()->where('x', 1)
->where('y', 2)->get();
$x = Model::query()
->where('x', 1)
->where('y', 2)
->get();
$x = Model::query()->
where('x', 1)->
where('y', 2)->
get();
Thanks!