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

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)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 47 - 12 = ?

 
 [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

Comments

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