FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18930&edit=1

ID: 18930
Updated by: sb@sebastian-bergmann.de
Reported By: sb at sebastian-bergmann dot de
Summary: Alternative namespace declaration syntax confuses
scope sniffs
-Status: Open
+Status: Duplicate
Type: Bug
Package: PHP_CodeSniffer
Operating System: Irrelevant
Package Version: 1.3.0
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

-Status: Open
+Status: Duplicate
Duplicate of http://pear.php.net/bugs/bug.php?id=18043.


Previous Comments:
------------------------------------------------------------------------

[2011-10-26 03:00:06] sebastian

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)
--------------------------------------------------------------------------------

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 26, '11 at 1:30a
activeOct 26, '11 at 1:30a
posts1
users1
websitepear.php.net

1 user in discussion

Sb: 1 post

People

Translate

site design / logo © 2022 Grokbase