-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
[ANNOTATIONS_TO_ATTRIBUTES] Upgrading Assert\Range leads to error #8300
Comments
Thank you for your report! We'll need an isolated failing demo link from: http://getrector.com/demo, The smaller demo the better 👍 |
ANNOTATIONS_TO_ATTRIBUTES is working fine until Doctrine annotations gets involved, it then just hangs forever and the --debug option does not provide any message. |
Thank you for your report! We'll still need an isolated failing demo link from: http://getrector.com/demo, Feel free to create a new one with demo link, so we can see the issue ourselves and fix it 👍 |
Recreating the issue is not possible on your test site as it depends on the libs it uses, still the output is not quite right, it just spits out 'use Doctrine\ORM\Mapping\Index;' on the top while leaving 'use Doctrine\ORM\Mapping\Index as Index;' as it is. |
Could you share the demo link with minimal PHP code that is causing the troubles? Only that way we can start digging |
https://getrector.com/demo/8669e371-05c9-477f-b32a-34ef1400bb99 |
Thanks 👍 @samsonasik Could you look into this one? Seems use import is being added despite already existing one. |
The issue seems unrelated with import. Alias name should be different with last name import in the namespace, it like doing useless alias: namespace App;
use stdClass as stdClass; which should not happen on the first place. @mindaugasvcs we need reproducible repo that show the issue, with before after expected output |
I think the solution is you can just simply remove the useless alias: -use Doctrine\ORM\Mapping\Index as Index;
+use Doctrine\ORM\Mapping\Index; as that useless, so I guess it is not a bug. |
I am closing it as it is not a bug, the alias name is same with last name, which should not happen on the first place. |
I created new special rule to remove useless alias in use statement as same with last name: |
@samsonasik Even better, thanks for the new rule 👍 |
Bug Report
The Symfony / Sensio annotation to attribute upgrade works great, except for one BC break. It is up for debate whether annotations should be 100% BC with attributes.
Minimal PHP Code Causing Issue
Actual Behaviour
The parameters are kept intact
Expected Behaviour
But should be changed to
notInRangeMessage
instead. Without changing it, an exception will be thrown.Maybe we can consider
The text was updated successfully, but these errors were encountered: