Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | 2 | public function __invoke(ContainerInterface $container, string $model): ObjectRepository |
|
16 | { |
||
17 | 2 | $em = $container->get(EntityManagerInterface::class); |
|
18 | |||
19 | 2 | if (false === $em instanceof EntityManagerInterface) { |
|
20 | 1 | throw new RuntimeException(sprintf( |
|
21 | 1 | ConfigProvider::CONTAINER_EXCEPTION_MESSAGE_PATTER, |
|
22 | 1 | EntityManagerInterface::class |
|
23 | )); |
||
24 | } |
||
25 | |||
26 | 1 | return $em->getRepository($model); |
|
27 | } |
||
29 |