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

[Php80] Handle Alias is used as Attribute on AnnotationToAttributeRector #1511

Merged
merged 5 commits into from
Dec 17, 2021

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 17, 2021

Given the following code:

use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\UseAlias\TestOther as TestOtherAlias;
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\UseAlias as TestFoo;

final class AliasUsed
{
    /**
    * @TestFoo\TestSmth
    */
    private string $foo;

    /**
    * @TestFoo\TestOther
    */
    private string $bar;

    /**
    * @TestOtherAlias
    */
    private string $baz;

}

It currently produce only 2 properties that updated:

-    /**
-    * @TestFoo\TestSmth
-    */
+    #[TestFoo\TestSmth]
     private string $foo;
 
-    /**
-    * @TestFoo\TestOther
-    */
+    #[TestFoo\TestOther]

The @TestOtherAlias should be updated as well to be:

+    #[TestOtherAlias]
     private string $baz;

This PR try to fixes rectorphp/rector#6867

@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

/cc @astronom

@samsonasik samsonasik merged commit db94f7a into main Dec 17, 2021
@samsonasik samsonasik deleted the handle-aliased-on-annotation-to-attribute branch December 17, 2021 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants