Plugin-php: Formatting: Heredoc/Nowdoc inside arrays and function calls

Created on 4 Apr 2018  路  1Comment  路  Source: prettier/plugin-php

Example output:

$content = array(<<<'EOF'
foo
EOF
, "bar");

Not sure what would be cleaner - maybe something like

$content = array(
<<<'EOF'
foo
EOF
    , "bar"
);
bug ugly

Most helpful comment

or

$content = array(
    <<<'EOF'
foo
EOF
    ,
    "bar"
);

(the first element can be indented normally, the comma is at the end of a line, and the second element starts on its own line)

>All comments

or

$content = array(
    <<<'EOF'
foo
EOF
    ,
    "bar"
);

(the first element can be indented normally, the comma is at the end of a line, and the second element starts on its own line)

Was this page helpful?
0 / 5 - 0 ratings