Skip to content

Commit

Permalink
Fix php8 compatibilities
Browse files Browse the repository at this point in the history
Signed-off-by: codisart <louis.celier@gmail.com>
  • Loading branch information
codisart committed Oct 8, 2020
1 parent dfc834b commit 85d4aa1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ClassFileLocator.php
Expand Up @@ -15,6 +15,14 @@
use RecursiveIteratorIterator;
use SplFileInfo;

if (!defined('T_NAME_QUALIFIED')) {
define('T_NAME_QUALIFIED', 314);
}

if (!defined('T_NAME_FULLY_QUALIFIED')) {
define('T_NAME_FULLY_QUALIFIED', 312);
}

/**
* Locate files containing PHP classes, interfaces, abstracts or traits
*/
Expand Down Expand Up @@ -112,15 +120,17 @@ public function accept()
}
continue;
}
list($type, $content, $line) = $token;
list($type, $content) = $token;
switch ($type) {
case T_STRING:
case T_NS_SEPARATOR:
case T_NAME_FULLY_QUALIFIED:
case T_NAME_QUALIFIED:
$namespace .= $content;
break;
}
}
if ($saveNamespace) {
if (isset($saveNamespace) && $saveNamespace) {
$savedNamespace = $namespace;
}
break;
Expand Down

0 comments on commit 85d4aa1

Please sign in to comment.