mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: add default autoconfigure and autowiring on Reports/Fixtures
This commit is contained in:
parent
7f96a895e1
commit
836cc7199e
@ -19,6 +19,7 @@ use Chill\ReportBundle\Entity\Report;
|
|||||||
use DateTime;
|
use DateTime;
|
||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Faker\Factory as FakerFactory;
|
use Faker\Factory as FakerFactory;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
@ -29,14 +30,13 @@ use function in_array;
|
|||||||
/**
|
/**
|
||||||
* Load reports into DB.
|
* 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;
|
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');
|
$this->faker = FakerFactory::create('fr_FR');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
|
_defaults:
|
||||||
|
autowire: true
|
||||||
|
autoconfigure: true
|
||||||
|
|
||||||
Chill\ReportBundle\DataFixtures\ORM\:
|
Chill\ReportBundle\DataFixtures\ORM\:
|
||||||
resource: ../../DataFixtures/ORM
|
resource: ../../DataFixtures/ORM
|
||||||
tags: [ 'doctrine.fixture.orm' ]
|
tags: [ 'doctrine.fixture.orm' ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user