fabpot/PHP-CS-Fixer — pull request #476 by sstok (2014-08-26 11:42:09+00:00)
Title: [feat] TrailingCommaInMultiLineArrayFixer

|Q |A |
|--- |---|
|Bug Fix? |n |
|New Feature? |yes|
|BC Breaks? |n |
|Deprecations?|n |
|Tests Pass? |yes|
|Fixed Tickets| |
|License |MIT|
|Doc PR | |

This adds the TrailingCommaInMultiLineArrayFixer: PHP Multi-line arrays should have a trailing comma

There is only minor problem that I was unable to resolve, when you have an array like.

```php

```

The result will be.

```php

```

Which is not fully correct, but the detection for this is problamatic.

We can't just add a new line, as that will move the closing brace to the beginging of the line.
And looking for the previous whitespace as something like `($y ? 'yes' : 'no')` will detect the wrong whitespace for indenting.

So we can either detect the missing new-line and add it, and let a nother fixer (or manual change) fix this.
Or leave this as it is now, and try to fix this later using either another fixer or improving this fixer.
Sent using [Gush](https://github.com/gushphp/gush)