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

Bug #16684 Bug in Squiz_Sniffs_PHP_NonExecutableCodeSniff
Submitted: 2009-10-07 22:22 UTC
From: kukulich Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.0)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2009-10-07 22:22 UTC] kukulich (Jaroslav Hanslík)
Description: ------------ The NonExecutableCodeSniff doesn't work as I expect. Test script: --------------- <?php switch (0) { case 1: echo '1'; break; echo 'non-executable'; default: break; } ?> Expected result: ---------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) ------------------------------------------------------------------------ 7 | WARNING | Code after BREAK statement cannot be executed Actual result: -------------- No warning

Comments

 [2009-10-08 17:31 UTC] kukulich (Jaroslav Hanslík)
Another error (it works with return in default). Test script: --------------- < ?php switch (0) { case 1: return '1'; echo 'non-executable'; default: break; } ?> Expected result: ---------------- FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S) ------------------------------------------------------------------------ 6 | WARNING | Code after RETURN statement cannot be executed ------------------------------------------------------------------------ Actual result: ---------------- FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S) ------------------------------------------------------------------------ 6 | WARNING | Code after RETURN statement cannot be executed 7 | WARNING | Code after RETURN statement cannot be executed ------------------------------------------------------------------------
 [2009-10-12 05:25 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 pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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.