| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function process(ContainerBuilder $container) |
||
| 30 | { |
||
| 31 | if (!$container->hasDefinition('doctrine.orm.container_repository_factory')) { |
||
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | $locatorDef = $container->getDefinition('doctrine.orm.container_repository_factory'); |
||
| 36 | |||
| 37 | $repoServiceIds = array_keys($container->findTaggedServiceIds(self::REPOSITORY_SERVICE_TAG)); |
||
| 38 | $repoReferences = array_map(function($id) { |
||
| 39 | return new Reference($id); |
||
| 40 | }, $repoServiceIds); |
||
| 41 | |||
| 42 | $ref = ServiceLocatorTagPass::register($container, array_combine($repoServiceIds, $repoReferences)); |
||
| 43 | $locatorDef->replaceArgument(0, $ref); |
||
| 44 | } |
||
| 45 | } |