diff --git a/composer.json b/composer.json index 47971b5cc..e3dbdc5ab 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "require": { "php": "^7.1 || ^8.0", "ext-tokenizer": "*", - "doctrine/lexer": "1.*", + "doctrine/lexer": "2.0.x-dev", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { diff --git a/lib/Doctrine/Common/Annotations/DocLexer.php b/lib/Doctrine/Common/Annotations/DocLexer.php index f6567c512..251de2cb5 100644 --- a/lib/Doctrine/Common/Annotations/DocLexer.php +++ b/lib/Doctrine/Common/Annotations/DocLexer.php @@ -4,6 +4,7 @@ use Doctrine\Common\Lexer\AbstractLexer; +use Doctrine\Common\Lexer\Token; use function ctype_alpha; use function is_numeric; use function str_replace; @@ -126,4 +127,12 @@ protected function getType(&$value) return $type; } + + /** @return array{value: int|string, type:string|int|null, position:int} */ + public function peek(): array + { + $token = parent::peek(); + + return (array) $token; + } }