Find the best Rector rule to solve your problem. Searching through 676 rules.

Found 1 rule. That's the one:

AddGetReferenceTypeRector

Change $this->getReference() in data fixtures to fill reference class directly

 use Doctrine\Common\DataFixtures\AbstractDataFixture;

 final class SomeFixture extends AbstractDataFixture
 {
     public function run(SomeEntity $someEntity)
     {
-        $someEntity->setSomePassedEntity($this->getReference('some-key'));
+        $someEntity->setSomePassedEntity($this->getReference('some-key'), SomeReference::class);
     }
 }