Permalink
Browse files

Fixed bug #19381 : traits and indetations in traits are not handled p…

…roperly. This adds generic support for trait tokenizing into the core.
  • Loading branch information...
1 parent a969326 commit f6e857c4baa702493da80efb2cde212ae75389e3 @gsherwood gsherwood committed Apr 27, 2012
@@ -77,6 +77,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
T_FUNCTION,
T_CLASS,
T_INTERFACE,
+ T_TRAIT,
T_IMPLEMENTS,
T_EXTENDS,
T_INSTANCEOF,
@@ -107,6 +107,13 @@ class PHP_CodeSniffer_Tokenizers_PHP
'shared' => false,
'with' => array(),
),
+ T_TRAIT => array(
+ 'start' => array(T_OPEN_CURLY_BRACKET),
+ 'end' => array(T_CLOSE_CURLY_BRACKET),
+ 'strict' => true,
+ 'shared' => false,
+ 'with' => array(),
+ ),
T_NAMESPACE => array(
'start' => array(T_OPEN_CURLY_BRACKET),
'end' => array(T_CLOSE_CURLY_BRACKET),
View
@@ -106,6 +106,7 @@
public static $weightings = array(
T_CLASS => 1000,
T_INTERFACE => 1000,
+ T_TRAIT => 1000,
T_NAMESPACE => 1000,
T_FUNCTION => 100,
T_CLOSURE => 100,
@@ -271,6 +272,7 @@
public static $scopeOpeners = array(
T_CLASS,
T_INTERFACE,
+ T_TRAIT,
T_NAMESPACE,
T_FUNCTION,
T_CLOSURE,
View
@@ -51,6 +51,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19354 : Not recognizing references passed to method
- Fixed bug #19361 : CSS tokenzier generates errors when PHP embedded in CSS file
- Fixed bug #19374 : HEREDOC/NOWDOC Indentation problems
+ - Fixed bug #19381 : traits and indetations in traits are not handled properly
- Fixed bug #19394 : Notice in NonExecutableCodeSniff
</notes>
<contents>

0 comments on commit f6e857c

Please sign in to comment.