Skip to content

Commit 25ab1c4

Browse files
committed
fix array-offset via "isset"-call
1 parent 7b2df70 commit 25ab1c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TypeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser
239239
$resolvedType = new Expression($type);
240240

241241
$types[] = $resolvedType;
242-
} elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && $token[0] === ')') {
242+
} elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') {
243243
break;
244244
} elseif ($token === '<') {
245245
if (count($types) === 0) {
@@ -406,7 +406,7 @@ private function isKeyword(string $type): bool
406406
*/
407407
private function isPartialStructuralElementName(string $type): bool
408408
{
409-
return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
409+
return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
410410
}
411411

412412
/**

0 commit comments

Comments
 (0)