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

Bug #12621 "space after AS" check is wrong.
Submitted: 2007-12-05 18:16 UTC
From: renoiv Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0RC3)
PHP Version: 5.2.5 OS: Windows 2000
Roadmaps: 1.0.0    
Subscription  


 [2007-12-05 18:16 UTC] renoiv (Satoshi Oikawa)
Description: ------------ "space after AS" check of Squiz_Sniffs_ControlStructures_ForEachLoopDeclarationSniff is wrong. I am not good at English. If a sentence of this bug is a unclear meaning, I am sorry. Test script: --------------- <?php foreach ($something as$thing) echo 'hello'; ?> Expected result: ---------------- [test@]$ phpcs --standard=Squiz foreachTest.php FILE: foreachTest.php -------------------------------------------------------------------------------- FOUND 4 ERROR(S) AND 0 WARNING(S) AFFECTING 2 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment 3 | ERROR | Expected 1 space before "as"; 2 found 3 | ERROR | Expected 1 space after "as"; 0 found 3 | ERROR | Inline control structures are not allowed. -------------------------------------------------------------------------------- Actual result: -------------- [test@]$ phpcs --standard=Squiz foreachTest.php FILE: foreachTest.php -------------------------------------------------------------------------------- FOUND 4 ERROR(S) AND 0 WARNING(S) AFFECTING 2 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment 3 | ERROR | Expected 1 space before "as"; 0 found 3 | ERROR | Expected 1 space after "as"; 0 found 3 | ERROR | Inline control structures are not allowed. --------------------------------------------------------------------------------

Comments

 [2007-12-05 22:12 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. 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. Thanks a lot for the patch.