Skip to content

Commit 456038f

Browse files
committed
No need to emulate traits any more as 5.3 isn't support in this version
1 parent 54b3a8d commit 456038f

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/Tokenizers/PHP.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -856,30 +856,6 @@ protected function tokenize($string)
856856
continue;
857857
}
858858

859-
/*
860-
Emulate traits in PHP versions less than 5.4.
861-
*/
862-
863-
if ($tokenIsArray === true
864-
&& $token[0] === T_STRING
865-
&& strtolower($token[1]) === 'trait'
866-
&& $tokens[($stackPtr - 1)][0] !== T_OBJECT_OPERATOR
867-
&& $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM
868-
) {
869-
$finalTokens[$newStackPtr] = array(
870-
'content' => $token[1],
871-
'code' => T_TRAIT,
872-
'type' => 'T_TRAIT',
873-
);
874-
875-
if (PHP_CODESNIFFER_VERBOSITY > 1) {
876-
echo "\t\t* token $stackPtr changed from T_STRING to T_TRAIT".PHP_EOL;
877-
}
878-
879-
$newStackPtr++;
880-
continue;
881-
}
882-
883859
/*
884860
PHP doesn't assign a token to goto labels, so we have to.
885861
These are just string tokens with a single colon after them. Double

0 commit comments

Comments
 (0)