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

[CodeQuality][Renaming] Handle DynamicDocBlockPropertyToNativePropertyRector+RenameClassRector with aliased name #6506

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Nov 24, 2024

Continue of

It currently only change assign, but property keep using old before renamed:

1) Rector\Tests\Issues\DynamicDocblockRename\DynamicDocblockRenameTest::test with data set #0 ('/Users/samsonasik/www/rector-...hp.inc')
Failed on fixture file "fixture.php.inc"

Applied Rector rules:
 * Rector\CodeQuality\Rector\Class_\DynamicDocBlockPropertyToNativePropertyRector
 * Rector\Renaming\Rector\Name\RenameClassRector

Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
 final class Fixture
 {
-    private ?\stdClass $someDependency;
+    private ?SomeSource\SomeDependency $someDependency;
     public function run(): void
     {
         $this->someDependency = new \stdClass();

make always fqcn seems the way to go.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 6e655b4 into main Nov 24, 2024
36 checks passed
@samsonasik samsonasik deleted the dyna-rename branch November 24, 2024 14:31
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

Successfully merging this pull request may close these issues.

2 participants