FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19692&edit=1

ID: 19692
Updated by: gsherwood@squiz.net
Reported By: donaldducky@gmail.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

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 7, '12 at 4:21a
activeNov 7, '12 at 4:21a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase