Skip to content

Commit 80ced34

Browse files
committed
Make compatible with PHP 8.0
1 parent 5ae8e2f commit 80ced34

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Adapter/Simple/ClassScanner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function getClassNameFromFile($file)
4747
for (; $i < count($tokens); $i++) {
4848
if ($tokens[$i][0] === \T_NAMESPACE) {
4949
for ($j = $i + 1; $j < count($tokens); $j++) {
50-
if ($tokens[$j][0] === T_STRING) {
50+
$tokenId = $tokens[$j][0];
51+
if ($tokenId === T_STRING || $tokenId === 314) {
5152
$namespace .= '\\' . $tokens[$j][1];
5253
} elseif ($tokens[$j] === '{' || $tokens[$j] === ';') {
5354
break;

tests/Integration/Simple/SimpleClassToFileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testClassToFile()
3030
]), $candidates);
3131
}
3232

33-
public function testClassToFileDeeper()
33+
public function testClassToFileDeeper(): void
3434
{
3535
$candidates = $this->classToFile->classToFileCandidates(ClassName::fromString('Acme\\NamespaceHere\\Hallo'));
3636

0 commit comments

Comments
 (0)