Adds support and unit tests for PHP 5.4 shorthand array syntax to ArrayBracketSpacingSniff.
This version just skips sniffing if it believes that the syntax is a shorthand array, rather than applying a different set of rules, but it would be easy to adapt the code to apply a new set of rules instead.
Add support for shorthand array syntax to ArrayBracketSpacingSniff. (…
Thanks a lot for patch. I decided to implement it slightly differently, using a blacklist (T_EQUAL) rather than a whitelist for square brackets. Essentially doing the same thing but ruling things out bit by bit.
Commit is here: b9f57bf
I'll close this now, but let me know if if anything is wrong.
Ah, the reason I did it the way I did is because  as an array is valid anywhere an expression is valid (from my understanding anyway, I don't have 5.4 installed anywhere handy to test at the moment), so that you can have situations like (but not limited to):
$value = ['key' => ['another', 'shorthand', 'array']];
$ret = myfunction($arg1, ['an array']);
$merged = $array + ['another' => 'array'];
As result it works out easier (IMO) to figure out if it's an array index use case, rather than if it's a short-hand array.