Find a Rector rule
Find the best Rector rule to solve your problem. Searching through 1064 rules.
Found 1 rule. That's the one: Clear
doctrine/data-fixtures
1 match
AddGetReferenceTypeRector
doctrine/data-fixtures >=1.6
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);
}
}