Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #35 from localheinz/fix/trait
Browse files Browse the repository at this point in the history
Fix: Constant T_TRAIT is defined
  • Loading branch information
weierophinney committed Jan 11, 2017
2 parents 7c17f7f + 0a131d5 commit 899e11b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ClassFileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function accept()
$contents = file_get_contents($file->getRealPath());
$tokens = token_get_all($contents);
$count = count($tokens);
$t_trait = defined('T_TRAIT') ? T_TRAIT : -1; // For preserve PHP 5.3 compatibility
for ($i = 0; $i < $count; $i++) {
$token = $tokens[$i];
if (! is_array($token)) {
Expand Down Expand Up @@ -117,7 +116,7 @@ public function accept()
$savedNamespace = $namespace;
}
break;
case $t_trait:
case T_TRAIT:
case T_CLASS:
// ignore T_CLASS after T_DOUBLE_COLON to allow PHP >=5.5 FQCN scalar resolution
if ($i > 0 && is_array($tokens[$i - 1]) && $tokens[$i - 1][0] === T_DOUBLE_COLON) {
Expand Down

0 comments on commit 899e11b

Please sign in to comment.