Plugin-php: Multiline string with variable indented more on every format on php-version >= 7.3

Created on 16 Nov 2020  路  4Comments  路  Source: prettier/plugin-php

@prettier/plugin-php v0.16.0
Playground link

Input:

<?php

class A
{
    public function b()
    {
        $this->c("
            This multiline string
            is indented more and more on every save.
            But only on --php-version >= 7.3
            and only when a variable is present: $test
        ");
    }
}

Output:

<?php

class A
{
    public function b()
    {
        $this->c("
                    This multiline string
                    is indented more and more on every save.
                    But only on --php-version >= 7.3
                    and only when a variable is present: $test
                ");
    }
}

bug high-pri

Most helpful comment

Fixed in v0.16.1 :tada:

All 4 comments

I have the same issue, it works on v15.0.1 but breaks from v15.0.2 and forward

Also same issue, tried downgrading to v0.15.1 as @kilbiller said, yet it still pushes the lines deeper each time I format the file.

Thanks for the bug report!

Fixed in v0.16.1 :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bertuz picture bertuz  路  5Comments

alexander-akait picture alexander-akait  路  3Comments

em4nl picture em4nl  路  5Comments

alexander-akait picture alexander-akait  路  5Comments

czosel picture czosel  路  5Comments