| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function process(ContainerBuilder $container) : void |
||
| 15 | { |
||
| 16 | // when ORM is not enabled |
||
| 17 | if (! $container->hasDefinition('doctrine.orm.container_repository_factory')) { |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | |||
| 21 | $locatorDef = $container->getDefinition('doctrine.orm.container_repository_factory'); |
||
| 22 | |||
| 23 | $repoServiceIds = array_keys($container->findTaggedServiceIds(self::REPOSITORY_SERVICE_TAG)); |
||
| 24 | |||
| 25 | $repoReferences = array_map(static function ($id) { |
||
| 26 | return new Reference($id); |
||
| 27 | }, $repoServiceIds); |
||
| 28 | |||
| 29 | $ref = ServiceLocatorTagPass::register($container, array_combine($repoServiceIds, $repoReferences)); |
||
| 30 | $locatorDef->replaceArgument(0, $ref); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |