Skip to content

Commit

Permalink
Allow doctrine/lexer 2
Browse files Browse the repository at this point in the history
It is still possible to avoid a BC-break while doing so.
  • Loading branch information
greg0ire committed Dec 10, 2022
1 parent 8708a31 commit 98d1200
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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": {
Expand Down
9 changes: 9 additions & 0 deletions lib/Doctrine/Common/Annotations/DocLexer.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 98d1200

Please sign in to comment.