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

Bug #19692 DisallowMultipleAssignments is triggered by a closure
Submitted: 2012-11-07 02:46 UTC
From: donaldducky Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.4.7 OS: OS X
Roadmaps: (Not assigned)    

 [2012-11-07 02:46 UTC] donaldducky (Donald Chea)
Description: ------------ Checked out from git @7083624 Used this sample standard: <?xml version="1.0"?> <ruleset name="Closure"> <description>Test closure.</description> <rule ref="Squiz.PHP.DisallowMultipleAssignments"/> </ruleset> Ran the command on the script from the git repo: scripts/phpcs --standard=Closure closure_multi_assignment.php Test script: --------------- <?php $closureWithDefaultParamter = function(array $testArray = array()) { }; Expected result: ---------------- No error Actual result: -------------- --------------------------------------------------------------------------- ----- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) --------------------------------------------------------------------------- ----- 2 | ERROR | Assignments must be the first block of code on a line


 [2012-11-07 09:21 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fixed in github repo: 6190ae20c4d3e6 Found a similar issue in another sniff as well.