Skip to content

Conversation

@darthf1
Copy link

@darthf1 darthf1 commented Dec 30, 2025

RemoveParentDelegatingConstructorRector removes the constructor of class DoSomething. But the $filterLocator param has an autowire attribute so it doesn't just delegates the variable to the parent but it also adds metadata and I expect it to be kept as-is.

@samsonasik
Copy link
Member

Could you provide documentation link when add autowire attribute on __construct matter so it can be future note why it is to be skipped?

@darthf1
Copy link
Author

darthf1 commented Dec 30, 2025

You mean a link like https://symfony.com/doc/current/service_container/autowiring.html?

Autowiring allows you to manage services in the container with minimal configuration. It reads the type-hints on your constructor (or other methods) and automatically passes the correct services to each method.

Do you want it in the fixture? Or just here?

@samsonasik
Copy link
Member

Add to fixture is fine, move parent class under Source

@darthf1
Copy link
Author

darthf1 commented Dec 30, 2025


namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector\Fixture;

abstract class AbstractDo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darthf1
Copy link
Author

darthf1 commented Dec 30, 2025

Its hard to do it in the web interface ;) Ill come back later and do it through the IDE.

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