Alexander Reifinger
Alexander Reifinger

Reputation: 532

PhpStorm AutoFormat: Align Multiline String Concatenation

The Zend format rule states that multiline string concatenation should be aligned under the "=" sign:

string $foo = "Lorem "
            . "ipsum";

PhpStorm does not seem to support this - it either aligns x spaces indented or it aligns the dot with the opening brace:

string $foo = "Lorem "
              . "ipsum";

Tested in V2017.1.2.

Anyone who managed to configure PS to comply to Zend format rules?

Upvotes: 1

Views: 785

Answers (1)

Dmitrii
Dmitrii

Reputation: 3557

They're aligned, if you reformat the whole file, e.g.:

function test(
    string $foo
    = "Lorem "
    . "ipsum"
) {
}

Do you have a full code sample?

Upvotes: 2

Related Questions