Bug #19655 [Asn->Csd]: Closures reporting as multi-line when they are not

From: Date: Fri, 26 Oct 2012 03:17:27 +0000
Subject: Bug #19655 [Asn->Csd]: Closures reporting as multi-line when they are not
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9245@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19655&edit=1 ID: 19655 Updated by: gsherwood@squiz.net Reported By: gnutix at gmail dot com Summary: Closures reporting as multi-line when they are not -Status: Assigned +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: Archlinux Package Version: 1.4.0 PHP Version: Irrelevant Assigned To: squiz Roadmap Versions: New Comment: -Status: Assigned +Status: Closed Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/53696950ac850628d90c217a0 5ba2565dd380b0f Previous Comments: ------------------------------------------------------------------------ [2012-10-26 04:02:46] squiz -Summary: [PSR2] &quot;Commas in multi-line function declaration...&quot; error that should not be +Summary: Closures reporting as multi-line when they are not -Assigned To: +Assigned To: squiz ------------------------------------------------------------------------ [2012-10-23 05:39:42] triplepoint I've got a fix prepared for this bug: https://github.com/squizlabs/PHP_CodeSniffer/pull/64 Not sure how this project is managing pull requests (github vs pear). Feel free to offer guidance. ------------------------------------------------------------------------ [2012-10-17 14:32:06] gnutix Description: ------------ When using for example a callback function with multiple parameters in a "function call on multiple lines", the comma used to separate the callback function parameters is interpreted as a "main function parameter separator". This produce the error "Commas in multi-line function declarations must be the last content on a line", even though it should not. Test script: --------------- <?php // foo.php $data = array('foo', 'bar', 'baz'); usort( $data, function ($a, $b) { // body } ); Expected result: ---------------- $ phpcs foo.php --standard=PSR2 Time: 0 seconds, Memory: 4.25Mb Actual result: -------------- $ phpcs foo.php --standard=PSR2 FILE: /home/lamp/foo.php ------------------------------------------------------------------------ -------- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) ------------------------------------------------------------------------ -------- 5 | ERROR | Commas in multi-line function declarations must be the last content on a line ------------------------------------------------------------------------ -------- Time: 0 seconds, Memory: 4.25Mb ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19655&edit=1

« previous php.pear.bugs (#9245) next »