Bug #19692 [Opn->Csd]: DisallowMultipleAssignments is triggered by a closure
| From: | gsherwood at squiz dot net | Date: | Wed, 07 Nov 2012 04:21:20 +0000 |
| Subject: | Bug #19692 [Opn->Csd]: DisallowMultipleAssignments is triggered by a closure | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-9304@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19692&edit=1
ID: 19692
Updated by: gsherwood@squiz.net
Reported By: donaldducky at gmail dot com
Summary: DisallowMultipleAssignments is triggered by a closure
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Operating System: OS X
Package Version: SVN
PHP Version: 5.4.7
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:
-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.
Previous Comments:
------------------------------------------------------------------------
[2012-11-06 21:46:34] donaldducky
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
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19692&edit=1