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

Bug #16530 ScopeIndentSniff reports false positive
Submitted: 2009-08-17 13:27 UTC
From: sebastian Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.0)
PHP Version: 5.3.0 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 29 + 3 = ?

 
 [2009-08-17 13:27 UTC] sebastian (Sebastian Bergmann)
Description: ------------ I think that Generic_Sniffs_Whitespace_ScopeIndentSniff reports false positives for case {} break; blocks. Test script: --------------- <?php switch (TRUE) { case TRUE: { /* ... */ } break; } Expected result: ---------------- No "Line indented incorrectly" error reported by PHP_CodeSniffer. Actual result: -------------- FILE: /home/sb/switch.php -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 5 | ERROR | Line indented incorrectly; expected at least 8 spaces, found 4 --------------------------------------------------------------------------------

Comments

 [2009-08-21 07:20 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Additional processing is now done by the PHP tokenizer to fix up the scope closers for CASE statements that use curly braces.