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

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)    
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:
Solve the problem : 42 - 39 = ?

 [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


 [2013-04-02 08:39 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fixed in github repo: 7e30d6abb7086