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

Bug #18844 Generic_Sniffs_CodeAnalysis_UnusedFunctionParameterSniff with empty body
Submitted: 2011-09-19 16:55 UTC
From: dvino Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    

 [2011-09-19 16:55 UTC] dvino (Dmitri Medvedev)
Description: ------------ methods with empty body and return throws an UnusedParameters errors. The problem is in the condition check on lines 97 and 104 in file PHP_CodeSniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php: $tokens[$tmp] === T_SEMICOLON, $tokens[$tmp] is an array so this condition check is always false. Change to $tokens[$tmp]['code'] === T_SEMICOLON solves the problem


 [2011-09-22 07:26 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Thanks for the patch.