Skip to content

Commit

Permalink
zendframework#7095 - Using T_TRAIT directly, as per PHP 5.4 support…
Browse files Browse the repository at this point in the history
… for it
  • Loading branch information
Ocramius committed Jan 13, 2015
1 parent 62986cc commit c83c7bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/Zend/File/ClassFileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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 @@ -114,7 +113,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 c83c7bb

Please sign in to comment.