Can you add new formatting options to place chaining method on a new line instead of a single line? Thanks and have more power!

Current:
$foo->bar()->baz()->quz();

To:

$foo
    ->bar()
    ->baz()
    ->quz();

    Thanks for the suggestion!

    Yes, that makes sense. I'm adding it to the list.

    4 days later

    Hello,

    Please check the latest preview version, it adds new format option php.format.rules.chainedMethodCallsWrap which can be set to always.

    In your case it would wrap like this:

    $foo->bar()
        ->baz()
        ->quz();

    But we can add another setting that would also add a new line before the first ->.

    Thank you

    Write a Reply...