Permalink
Browse files

Fixed bug #19871 : findExtendedClassName doesn't return FQCN on names…

…paced classes
  • Loading branch information...
1 parent 638d340 commit 3d76bbbc632a53679dce3fffa3a7e30d6abb7086 @gsherwood gsherwood committed Apr 2, 2013
View
@@ -2848,12 +2848,21 @@ public function findExtendedClassName($stackPtr)
return false;
}
- $stringIndex = $this->findNext(T_STRING, $extendsIndex, $classCloserIndex);
- if (false === $stringIndex) {
+ $find = array(
+ T_NS_SEPARATOR,
+ T_STRING,
+ T_WHITESPACE,
+ );
+
+ $end = $this->findNext($find, ($extendsIndex + 1), $classCloserIndex, true);
+ $name = $this->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1));
+ $name = trim($name);
+
+ if ($name === '') {
return false;
}
- return $this->_tokens[$stringIndex]['content'];
+ return $name;
}//end findExtendedClassName()
@@ -28,4 +28,12 @@ class MyClass
}
}
-?>
+
+class MyClass extends \MyNamespace\SomeClass
+{
+ function __construct() {
+ something::MyNamespace();
+ }
+
+}
+?>
View
@@ -53,6 +53,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19819 : Freeze with syntax error in use statement
- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
- Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed
+ - Fixed bug #19871 : findExtendedClassName doesn't return FQCN on namespaced classes
</notes>
<contents>
<dir name="/">

0 comments on commit 3d76bbb

Please sign in to comment.