Skip to content

Commit

Permalink
Allow variable list on one line for multiline closures
Browse files Browse the repository at this point in the history
https://www.php-fig.org/psr/psr-2/#6-closures explicitly shows that the
following is allowed:

```
$longArgs_shortVars = function (
    $longArgument,
    $longerArgument,
    $muchLongerArgument
) use ($var1) {
    // body
};
```
  • Loading branch information
Ashoka de Wit committed Oct 10, 2018
1 parent 598cbd3 commit 21157ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MediactCommon/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<description>MediaCT its extension to PSR2.</description>

<!-- Base rules on PSR2 -->
<rule ref="PSR2"/>
<rule ref="PSR2">
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.UseOneParamPerLine" />
</rule>

<!-- Arrays -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
Expand Down

0 comments on commit 21157ae

Please sign in to comment.