Skip to content

Commit a784fe8

Browse files
committed
fix array-offset via "isset"-call
1 parent 95d8782 commit a784fe8

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
@@ -224,7 +224,7 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser
224224
$resolvedType = new Expression($type);
225225

226226
$types[] = $resolvedType;
227-
} elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && $token[0] === ')') {
227+
} elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') {
228228
break;
229229
} elseif ($token === '<') {
230230
if (count($types) === 0) {
@@ -378,7 +378,7 @@ private function isKeyword(string $type) : bool
378378
*/
379379
private function isPartialStructuralElementName(string $type) : bool
380380
{
381-
return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
381+
return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
382382
}
383383

384384
/**

0 commit comments

Comments
 (0)