squizlabs/PHP_CodeSniffer — pull request #20 by edorian (2012-03-19 15:45:08+00:00)
Title: Allow javascript style closure syntax in FunctionCallSignatureSniff

When using custom sorting functions the syntax I've seen used most often was the following adapted, i assume, from javascript:

```php
usort($rawData, function($a, $b) use ($sorting) {
return strnatcasecmp($a->getAttribute($sorting), $b->getAttribute($sorting));
});
```

The sniffs forbids this forcing a syntax like:

```php
usort(
$rawData,
function($a, $b) use ($sorting) {
return strnatcasecmp($a->getAttribute($sorting), $b->getAttribute($sorting));
}
);
```

which I don't see people use all that much. Hence the pull request.

It is quite possible that this is the wrong solution. My basic requirement would be "Use most of the sniff".

So If you'd rather have a flag for this or have any other way that doesn't require overriding the massive method like maybe just factoring out the checks in a protected methods that I could override would do it would be great too.

So feel free to close this and tell me how to solve it if that solution is not acceptable :)