diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 233634878..80c1edd87 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -19,6 +19,7 @@ use Chill\ReportBundle\Entity\Report; use DateTime; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ObjectManager; use Faker\Factory as FakerFactory; use Symfony\Component\DependencyInjection\ContainerAwareInterface; @@ -29,14 +30,13 @@ use function in_array; /** * Load reports into DB. */ -class LoadReports extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface +final class LoadReports extends AbstractFixture implements OrderedFixtureInterface { - use \Symfony\Component\DependencyInjection\ContainerAwareTrait; - private readonly \Faker\Generator $faker; - public function __construct(private readonly \Doctrine\ORM\EntityManager $entityManager) - { + public function __construct( + private readonly EntityManagerInterface $entityManager + ) { $this->faker = FakerFactory::create('fr_FR'); } diff --git a/src/Bundle/ChillReportBundle/config/services/fixtures.yaml b/src/Bundle/ChillReportBundle/config/services/fixtures.yaml index 6362bbfe7..668cf8941 100644 --- a/src/Bundle/ChillReportBundle/config/services/fixtures.yaml +++ b/src/Bundle/ChillReportBundle/config/services/fixtures.yaml @@ -1,4 +1,8 @@ services: + _defaults: + autowire: true + autoconfigure: true + Chill\ReportBundle\DataFixtures\ORM\: resource: ../../DataFixtures/ORM - tags: [ 'doctrine.fixture.orm' ] \ No newline at end of file + tags: [ 'doctrine.fixture.orm' ]