Permalink
Browse files

Fixed bug #19763 : Use statements for traits not recognised correctly…

… for PSR2 code style
  • Loading branch information...
1 parent cc0c8bf commit ab0465ecdf244fd3e9d1224c9f60db6a51915833 @gsherwood gsherwood committed Jan 6, 2013
@@ -60,6 +60,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
return;
}
+ // Ignore USE keywords for traits.
+ if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === TRUE) {
+ return;
+ }
+
// Only one USE declaration allowed per statement.
$next = $phpcsFile->findNext(array(T_COMMA, T_SEMICOLON), ($stackPtr + 1));
if ($tokens[$next]['code'] === T_COMMA) {
@@ -19,3 +19,8 @@ $var = new MyClass(
return true;
}
);
+
+class Container extends Component implements IContainer
+{
+ use TContainer;
+}
View
@@ -32,6 +32,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Notifysend report now supports notify-send versions before 0.7.3
-- Thanks to Ken Guest for the patch
- Fixed bug #19755 : Token of T_CLASS type has no scope_opener and scope_closer keys
+ - Fixed bug #19763 : Use statements for traits not recognised correctly for PSR2 code style
- Fixed bug #19764 : Instead of for traits throws uppercase constant name errors
</notes>
<contents>

0 comments on commit ab0465e

Please sign in to comment.