Skip to content

Commit 722e695

Browse files
committed
A fix for parsing namespaces.
1 parent 7a9593c commit 722e695

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Code/Generator/ClassNameParser.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public function parseClassName(string $content): string
2020
for (; $i < $tokensCount; $i++) {
2121
if ($tokens[$i][0] === T_NAMESPACE) {
2222
for ($j = $i + 1; $j < $tokensCount; $j++) {
23-
if ($tokens[$j][0] === T_STRING) {
23+
// T_NAME_QUALIFIED for PHP > 8.0, T_STRING as fallback
24+
if ($tokens[$j][0] === T_NAME_QUALIFIED || $tokens[$j][0] === T_STRING) {
2425
$namespace .= '\\' . $tokens[$j][1];
2526
} else {
2627
if ($tokens[$j] === '{' || $tokens[$j] === ';') {

0 commit comments

Comments
 (0)