Skip to content

Commit fe41935

Browse files
committed
Infinite loop could occur when no closing use token found
1 parent e4583ac commit fe41935

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Types/ContextFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ private function parseUseStatement(ArrayIterator $tokens) : array
220220
if ($tokens->current()[0] === self::T_LITERAL_END_OF_USE) {
221221
return $uses;
222222
}
223+
224+
if ($tokens->current() === false) {
225+
break;
226+
}
223227
}
224228

225229
return $uses;

0 commit comments

Comments
 (0)