Permalink
Browse files

Fixed bug #19997 : Class names incorrectly detected as constants

  • Loading branch information...
1 parent afa9112 commit ed9e03367c1f1e17e0b83a0cc8e0ce6fb56b992a @gsherwood gsherwood committed Jun 26, 2013
@@ -79,6 +79,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
if ($tokens[$prevPtr]['code'] === T_CLASS
|| $tokens[$prevPtr]['code'] === T_EXTENDS
|| $tokens[$prevPtr]['code'] === T_IMPLEMENTS
+ || $tokens[$prevPtr]['code'] === T_NEW
) {
return;
}
@@ -70,6 +70,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
if ($tokens[$prevPtr]['code'] === T_CLASS
|| $tokens[$prevPtr]['code'] === T_EXTENDS
|| $tokens[$prevPtr]['code'] === T_IMPLEMENTS
+ || $tokens[$prevPtr]['code'] === T_NEW
) {
return;
}
@@ -54,4 +54,13 @@ use Zend\Log\Writer\NULL as NullWriter;
new \Zend\Log\Writer\NULL()
class True extends Null implements False {}
+
+use Something\True;
+class MyClass
+{
+ public function myFunction()
+ {
+ $var = array('foo' => new True());
+ }
+}
?>
@@ -55,4 +55,13 @@ new \Zend\Log\Writer\Null()
class True extends Null implements False {}
+use Something\True;
+class MyClass
+{
+ public function myFunction()
+ {
+ $var = array('foo' => new True());
+ }
+}
+
?>
View
@@ -78,6 +78,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19957 : Does not understand trait method aliasing
- Fixed bug #19968 : Permission denied on excluded directory
- Fixed bug #19969 : Sniffs with namespace not recognized in reports
+ - Fixed bug #19997 : Class names incorrectly detected as constants
</notes>
<contents>
<dir name="/">

0 comments on commit ed9e033

Please sign in to comment.