DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
85 stars 10 forks source link

Show and remove unused constructor-based dependency injections (DI) #616

Open Morgy93 opened 4 months ago

Morgy93 commented 4 months ago

Hello,

I'd love to have a feature where it shows and is able to remove unused constructor-based dependency injections (DI).

For example:

public function __construct(
        private readonly \Some\Class $someClass,
) {
}

If $this->someClass is nowhere found in the code, I'd like to have some "this DI is not used, do you want to remove?"-Feature.

There's a feature for "Remove Unused Uses" and that would be great for the DI stuff as well. 😊

jakubmisek commented 3 months ago

Good idea!