-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ExpressionLanguage] Fixed PhpDoc type-hints on Token value #24884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phpdoc is not accurate then. And please add a test
85ac690
to
db5a4d8
Compare
Thanks for review, I changed the phpdoc and added a test to cover this. |
* @param string $value The token value | ||
* @param int $cursor The cursor position in the source | ||
* @param string $type The type of the token (self::*_TYPE) | ||
* @param string|int|float $value The token value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|null
as the previous typehint was nullable too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scalar|null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added null because scalar seems to not be recognize and I could not find it in php doc @nicolas-grekas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(could be merged on a lower branch I guess)
PhpDoc and tests can effectively be merged in lower branch version. But removing the typeHint is a 4.0 issue... Should I open an other PR on a lower branch? @nicolas-grekas |
Removing the type will come naturally when merging up to master I think. |
Also added tests to cover number parser BC
I moved it to lower active branch 2.7. |
Thank you @mcg-web. |
…lue (mcg-web) This PR was merged into the 2.7 branch. Discussion ---------- [ExpressionLanguage] Fixed PhpDoc type-hints on Token value | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none Fixed PhpDoc type-hints on Token value and added test to prevent BC with Parser when treating numbers (example `a === 123` compile as `$a === "123"`) Commits ------- 18f0fc5 [ExpressionLanguage] Fix PhpDoc type-hints on Token value
Fixed PhpDoc type-hints on Token value and added test to prevent BC with Parser when treating numbers (example
a === 123
compile as$a === "123"
)