-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Repost from squizlabs/PHP_CodeSniffer#1699:
Proposal: add
list()
to theTokens::$functionNameTokens
propertyWhile
list
is a language construct, for the purpose of formatting, it is normally treated as if it were a function call, similar to howisset()
orempty()
are treated.To that end, I propose adding
list
to theTokens::$functionNameTokens
property.There are two sniffs within PHPCS whose behaviour will change if this proposal is accepted:
Generic.Functions.FunctionCallArgumentSpacing
PEAR.Functions.FunctionCallSignature
(and by extensionPSR2.Methods.FunctionCallSignature
)For the
Generic.Functions.FunctionCallArgumentSpacing
, it would mean that a slight adjustment is needed to account for the possibility of an empty element, like inlist($drink, , $power) = $info;
which would otherwise trigger ano space allowed before comma
error.I'd be happy to create a PR to handle this if there is support for this proposal.
Opinions ?