Skip to content
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

\Doctrine\Common\Lexer\input #30

Closed
grzegorz-pierzakowski opened this issue Jul 31, 2019 · 4 comments
Closed

\Doctrine\Common\Lexer\input #30

grzegorz-pierzakowski opened this issue Jul 31, 2019 · 4 comments
Labels

Comments

@grzegorz-pierzakowski
Copy link

Hi,
on Line 255 there is preg_split($this->regex, $input, -1, $flags)
should be preg_split($this->regex, (string)$input, -1, $flags) due to 7.3 type casting
can you fix this, please
Thanks

@xabbuh
Copy link
Member

xabbuh commented Jul 31, 2019

Why would that be necessary? The docblock (https://github.com/doctrine/lexer/blob/master/lib/Doctrine/Common/Lexer/AbstractLexer.php#L239) states that $input is a string.

@alcaeus
Copy link
Member

alcaeus commented Aug 1, 2019

As @xabbuh said, the docblock clearly expects a string in setInput which is then passed on to scan. Nothing has changed from the last release, so passing anything other than a string is just as invalid as it used to be. That's why we recommend using static analysers like PHPStan or psalm to ensure your code doesn't call setInput with anything other than a string.

@alcaeus alcaeus closed this as completed Aug 1, 2019
@alcaeus alcaeus added the invalid label Aug 1, 2019
@grzegorz-pierzakowski
Copy link
Author

grzegorz-pierzakowski commented Aug 1, 2019

The doc bloc does not prevent user from calling this with a float.
Docs do not mean anything, those are just hints.
Please reopen this.

@malarzm
Copy link
Member

malarzm commented Aug 2, 2019

Hmmm could this happen with something like @Annotation(float=2.1)? Anyways cross referencing #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants