- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Hi,
I was just going through release notes of 2.4
and I have noticed that since #768 it is possible to write comments after opening parenthesis in multiline calls, that's great for me, I always thought that this will never be changed. Since we have this change I think comments should be allowed in declaration as well. Because now the call is ok, but declaration throws error in PSR2
:
function foo( // this throws an error $bar, $baz ) { // this comment is ok // ... } foo( // this comment is ok 'bar', 'baz' );
3 | ERROR | [x] The first parameter of a multi-line function | | declaration must be on the line after the opening | | bracket | | (Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing)
What's more, the error message is somewhat misleading.
I would probably never write such a declaration, but this applies also to anonymous functions, where it's much more likely.