Php-cs-fixer: Can not format with ```['url' => $url] = $data;```

Created on 26 Mar 2018  路  2Comments  路  Source: FriendsOfPHP/PHP-CS-Fixer

PHP7.2
CSFixer: 2.1.1

If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):

  • before running PHP CS Fixer (no changes):
[                  'url' => $url                         ] = $data;
  • with unexpected changes applied when running PHP CS Fixer:
[                  'url' => $url                         ] = $data; //no change, shall be trim spaces.
  • with the changes you expected instead:
['url' => $url] = $data;

I have look around API several times but not found option about that.

kinfeature request

Most helpful comment

Yes, I will try. Thanks for reply.

All 2 comments

I don't believe we have option for that so far, we have trim_array_spaces for arrays, but not for list. I bet it's super simple to introduce new rule that would mimic it but for lists. Would you like to give it a try, @kmvan ?

Yes, I will try. Thanks for reply.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndench picture ndench  路  3Comments

BackEndTea picture BackEndTea  路  3Comments

EvgenyOrekhov picture EvgenyOrekhov  路  3Comments

ro0NL picture ro0NL  路  3Comments

UksusoFF picture UksusoFF  路  3Comments