Plugin-php: Pretty output double quotes strings

Created on 1 Mar 2018  路  2Comments  路  Source: prettier/plugin-php

We have two syntax:

  • Easy
$string = "Foo ${bar}";
  • Complex (curly) syntax
$string = "Foo {$bar}";

Ref: http://php.net/manual/en/language.types.string.php

Should we:

  1. Output encapsed string as is.
  2. Output always into complex (curly) syntax.

Most helpful comment

I'd leave them the way we find them for now, because for complex expressions the two styles have different meaning. That requires https://github.com/glayzzle/php-parser/issues/101 to be implemented though.

All 2 comments

I'd leave them the way we find them for now, because for complex expressions the two styles have different meaning. That requires https://github.com/glayzzle/php-parser/issues/101 to be implemented though.

I'll close this for now since there is a PR for the parser feature now :smile:

Was this page helpful?
0 / 5 - 0 ratings