doctrine / lexer

Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
https://www.doctrine-project.org/projects/lexer.html
MIT License
11.05k stars 60 forks source link

fix bug Doctrine\\Common\\Lexer\\Token::__construct(): Argument #1 ($… #119

Closed SakhriHoussem closed 1 month ago

SakhriHoussem commented 4 months ago

fix bug Doctrine\Common\Lexer\Token::__construct(): Argument #1 ($value) must be of type string|int, float given, called in vendor/doctrine/lexer/src/AbstractLexer.php on line 261 Token.php

PowerKiKi commented 1 month ago

I am having the same issue, which would be solved by this PR.

The issue is that it is possible that the value is numeric as written in the comment, but in PHP numeric means int|float. int by itself is not enough, and we must allow float to be able parse float values.

PowerKiKi commented 1 month ago

Because the replacement #124 has been merged, this PR should now be rejected.