Given we have a set of classes that use a ExampleTrait that needs ExampleDependency, RemoveUnusedPrivatePropertyRector removes ExampleDependency from Example
class Example{
use ExampleTrait;
private $dep;
public function __constructor(ExampleDependency $dep)
{
$this->dep = $dep;
}
}
trait ExampleTrait{
private function doSomething()
{
$this->dep->doWork();
}
}
would result in
class Example{
use ExampleTrait;
public function __constructor(ExampleDependency $dep)
{
}
}
and together with RemoveUnusedPrivateMethodRector bug reported in #1334 would result in: