Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Request #20216 Add support for List declarations
Submitted: 2014-03-08 04:02 UTC
From: moorereason Assigned:
Status: Open Package: PHP_CodeSniffer (version 1.5.2)
PHP Version: Irrelevant OS: CentOS 6
Roadmaps: (Not assigned)    
Subscription  


 [2014-03-08 04:02 UTC] moorereason (Cameron Moore)
Description: ------------ The use of a List keyword is not validated in the same way that an Array declaration is. Lists are only validated as being lowercase (in Generic.PHP.LowerCaseKeyword). Test script: --------------- list($a, $b) = foo(); // good list(,, $a, $b) = foo(); // good list($a,$b) = foo(); // error - no space after comma list(,,$a, $b) = foo(); // error - space after open paren Expected result: ---------------- I expect a List to be validated similarly to an Array (except without the key=>value features).

Comments