phpstan / phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics
MIT License
1.32k stars 62 forks source link

Add "+" sign support for float exponent #191

Closed mvorisek closed 1 year ago

mvorisek commented 1 year ago

in scientific format + after E is normally present

also test if the parsed numbers are not converted thru native float/int type which can loose precision

mvorisek commented 1 year ago

@ondrejmirtes I have rebased this PR from 1.9.x to 1.20.x and the first 3 PR seems to be missing in 1.20.x! Please check that:

image

ondrejmirtes commented 1 year ago

Because there's 1.21.x.

mvorisek commented 1 year ago

rebased and retargeted on 1.21.x

mvorisek commented 1 year ago

This PR is done. Support for PHP CS Fixer for + has been already landed. "Test Slevomat Coding Standard" CI failures are unrelated.

ondrejmirtes commented 1 year ago

Thank you. Feel free to submit another PR that allows + at the beginning of numbers. I feel like these are two separate problems so they should be handled separately. It felt out of place in this PR but I just noticed that doctrine/annotations also support that (and I'm currently adding support here to be also able to parse the doctrine/annotations syntax) so this will come in handy. Thank you once more.