diff --git a/src/Bundle/ChillMainBundle/Export/ExportConfigNormalizer.php b/src/Bundle/ChillMainBundle/Export/ExportConfigNormalizer.php index 8e5a2a990..46bd8b202 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportConfigNormalizer.php +++ b/src/Bundle/ChillMainBundle/Export/ExportConfigNormalizer.php @@ -18,6 +18,7 @@ use Chill\MainBundle\Form\Type\Export\ExportType; use Chill\MainBundle\Form\Type\Export\FilterType; use Chill\MainBundle\Repository\CenterRepositoryInterface; use Chill\MainBundle\Repository\RegroupmentRepository; +use Chill\MainBundle\Repository\RegroupmentRepositoryInterface; /** * @phpstan-type NormalizedData array{centers: array{centers: list, regroupments: list}, export: array{form: array, version: int}, filters: array, version: int}>, aggregators: array, version: int}>, pick_formatter: string, formatter: array{form: array, version: int}} @@ -27,7 +28,7 @@ class ExportConfigNormalizer public function __construct( private readonly ExportManager $exportManager, private readonly CenterRepositoryInterface $centerRepository, - private readonly RegroupmentRepository $regroupmentRepository, + private readonly RegroupmentRepositoryInterface $regroupmentRepository, ) {} /** diff --git a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php index 793015f5b..76295cded 100644 --- a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php @@ -18,7 +18,7 @@ use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; use Doctrine\Persistence\ObjectRepository; -final readonly class RegroupmentRepository implements ObjectRepository +final readonly class RegroupmentRepository implements RegroupmentRepositoryInterface { private EntityRepository $repository; diff --git a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepositoryInterface.php new file mode 100644 index 000000000..f3337df7a --- /dev/null +++ b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepositoryInterface.php @@ -0,0 +1,25 @@ + + */ +interface RegroupmentRepositoryInterface extends ObjectRepository +{ + /** + * @throws NonUniqueResultException + * @throws NoResultException + */ + public function findOneByName(string $name): ?Regroupment; + + /** + * @return array + */ + public function findRegroupmentAssociatedToNoCenter(): array; +}