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

Bug #19871 findExtendedClassName doesn't return FQCN on namespaced classes
Submitted: 2013-03-28 15:23 UTC
From: bramstroker Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.0RC1)
PHP Version: 5.4.0 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2013-03-28 15:23 UTC] bramstroker (Bram Gerritsen)
Description: ------------ The method `findExtendedClassName()` in `PHP_CodeSniffer_File` seems to misbehave on namespaced classes. I'm expecting to get the FQCN when I use namespaced classes but it only returns the first namespace Test script: --------------- My class: class MyClass extends \MyNamespace\SomeClass { } Code in a sniff: $classIndex = $phpcsFile->findNext(array(T_CLASS), 0); $extendedClassName = $phpcsFile->findExtendedClassName($classIndex); var_dump($extendedClassName); Expected result: ---------------- \MyNamespace\SomeClass Actual result: -------------- MyNamespace

Comments

 [2013-04-02 08:39 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/3d76bbbc632a53679dce3fffa3a 7e30d6abb7086