Plugin-php: [feature] support difference value for trailing commas

Created on 12 Oct 2018  路  3Comments  路  Source: prettier/plugin-php

Values:

  • none doesn't print any trailing commas.
  • php5.0 print trailing commas for array
  • php7.2 include all for php7.2 + list and use (grouped namepaces only).
  • php7.3 include all for php7.2 + function calls (https://wiki.php.net/rfc/trailing-comma-function-calls).
  • all is latest stable PHP release (right now it is php7.2, in near future php7.3).

Somebody know when PHP starts support trailing commas for array ? :smile: But php5.0 looks good for me because minimum supported version is 5.

Feel free to feedback

discussion

Most helpful comment

Right now we're supporting none and all. The all setting will add trailing commas in multiline arrays.

All 3 comments

/cc @czosel

Sounds great! Prettier for JS has the same option, so I'd say it's a good fit for PHP as well. I don't know since when trailing commas in arrays were supported, but PHP 5 seems fine.

Right now we're supporting none and all. The all setting will add trailing commas in multiline arrays.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ichiriac picture ichiriac  路  3Comments

czosel picture czosel  路  6Comments

aboyton picture aboyton  路  4Comments

nikulis picture nikulis  路  5Comments

hawkrives picture hawkrives  路  3Comments