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

Bug #18930 Alternative namespace declaration syntax confuses scope sniffs
Submitted: 2011-10-26 07:00 UTC
From: sebastian Assigned:
Status: Duplicate Package: PHP_CodeSniffer (version 1.3.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2011-10-26 07:00 UTC] sebastian (Sebastian Bergmann)
Description: ------------ When using the alternative namespace declaration syntax (namespace <name> { ... }), sniffs that look at scope indentation are "confused" and report false positive violations. Test script: --------------- <?php namespace Foo { class Bar { public function baz() { } } } Expected result: ---------------- FILE: /home/sb/test.php -------------------------------------------------------------------------------- FOUND 6 ERROR(S) AFFECTING 4 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment (PEAR.Commenting.FileComment.Missing) 4 | ERROR | Missing class doc comment (PEAR.Commenting.ClassComment.Missing) 6 | ERROR | Missing function doc comment | | (PEAR.Commenting.FunctionComment.Missing) -------------------------------------------------------------------------------- Actual result: -------------- FILE: /home/sb/test.php -------------------------------------------------------------------------------- FOUND 6 ERROR(S) AFFECTING 4 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment (PEAR.Commenting.FileComment.Missing) 4 | ERROR | Missing class doc comment (PEAR.Commenting.ClassComment.Missing) 4 | ERROR | Line indented incorrectly; expected 0 spaces, found 4 | | (PEAR.WhiteSpace.ScopeIndent.Incorrect) 5 | ERROR | Expected 0 spaces before opening brace; 4 found | | (PEAR.Classes.ClassDeclaration.SpaceBeforeBrace) 6 | ERROR | Missing function doc comment | | (PEAR.Commenting.FunctionComment.Missing) 6 | ERROR | Line indented incorrectly; expected 4 spaces, found 8 | | (PEAR.WhiteSpace.ScopeIndent.Incorrect) --------------------------------------------------------------------------------

Comments

 [2011-10-26 07:03 UTC] sebastian (Sebastian Bergmann)
-Status: Open +Status: Duplicate
Duplicate of http://pear.php.net/bugs/bug.php?id=18043.