Skip to content

Commit fabbcd7

Browse files
authoredMar 25, 2022
Merge pull request #2640 from gerdemann/bugfix/composer-php8
BUGFIX: Fix PhpAnalyzer to support PHP 8
2 parents e3d2447 + 3aade8b commit fabbcd7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎Neos.Flow/Classes/Utility/PhpAnalyzer.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ public function extractNamespace(): ?string
8282
break;
8383
}
8484
list($type, $value) = $token;
85+
if (defined('T_NAME_QUALIFIED') && $type === T_NAME_QUALIFIED) {
86+
return $value;
87+
}
88+
if (defined('T_NAME_FULLY_QUALIFIED') && $type === T_NAME_FULLY_QUALIFIED) {
89+
return ltrim($value, '\\');
90+
}
8591
if ($type === T_STRING) {
86-
$namespaceParts[] = $value;
92+
$namespaceParts[] = ltrim($value, '\\');
8793
continue;
8894
}
8995
if ($type !== T_NS_SEPARATOR && $type !== T_WHITESPACE) {

0 commit comments

Comments
 (0)
Please sign in to comment.