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

Bug with PhpParser when instantiating the Tokenizer #490

Open
odahcam opened this issue Sep 5, 2023 · 1 comment
Open

Bug with PhpParser when instantiating the Tokenizer #490

odahcam opened this issue Sep 5, 2023 · 1 comment

Comments

@odahcam
Copy link

odahcam commented Sep 5, 2023

Reference:

https://github.com/doctrine/annotations/blame/6d4929214d8593ed80364267d6665edd70c2ecbe/lib/Doctrine/Common/Annotations/PhpParser.php#L60

This piece of code prepends a "<?php " string to the original content, but if the content already has the "<?php " opening tag, it errors and breaks the runtime.

@odahcam
Copy link
Author

odahcam commented Sep 5, 2023

It has something to do with an anonymous class, the reflection class returns no namespace for it, even though it is on a namespaced file. To be honest I don't know if it should return a namespace or not, I also don't remember how anonymous functions behave in that scenario. Anyhow I think there could be a condition for this kind of class: https://github.com/doctrine/annotations/pull/491/files

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

No branches or pull requests

1 participant