[PEAR-BUG] Bug #18624 [Opn->Csd]: @throws namespace problem

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18624&edit=1

 ID:               18624
 Updated by:       [email protected]
 Reported By:      gavin dot davies at boxuk dot com
 Summary:          @throws namespace problem
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: Ubuntu
 Package Version:  1.3.0
 PHP Version:      5.3.6
-Assigned To:      
+Assigned To:      squiz
 Roadmap Versions: 
 New Comment:

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

Thanks a lot for the patch.


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

[2011-06-23 14:40:37] boxgav

Added #patch bug:18624;patch:fixissue18624;revision:1308836437;.

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

[2011-06-23 13:58:02] boxgav

Description:
------------
When checking namespace annotations, using a backslash to indicate the
root namespace causes the sniff to fail when it's actually OK.

Test script:
---------------
<?php
/**
 * @package testdata.shouldpass
 */
namespace Foo\Bar;

class FooBarException extends \Exception {}

class NamespacedException {
    /**
     * @throws \Exception
     */
    public function foo() {
        throw new \Exception();
    }
    
    /**
     * @throws \Foo\Bar\FooBarException
     */
    public function fooBar2() {
        throw new \Foo\Bar\FooBarException();
    }
}

Expected result:
----------------
It should pick up the \Namespace\Stuff as part of the Exception name



Actual result:
--------------
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 13 | ERROR | Expected "Exception" but found "\Exception" for @throws
tag
    |       | exception
 27 | ERROR | Expected "Foo" but found "\Foo\Bar\FooBarException" for
@throws
    |       | tag exception
--------------------------------------------------------------------------------

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


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18624&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.