Conditions | 6 |
Paths | 5 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function process(ContainerBuilder $container) |
||
21 | { |
||
22 | $subscriberId = 'doctrine.orm.listeners.pdo_cache_adapter_doctrine_schema_subscriber'; |
||
23 | |||
24 | if (! $container->hasDefinition($subscriberId)) { |
||
25 | return; |
||
26 | } |
||
27 | |||
28 | $cacheAdaptersReferences = []; |
||
29 | foreach ($container->getDefinitions() as $id => $definition) { |
||
30 | if ($definition->isAbstract() || $definition->isSynthetic()) { |
||
31 | continue; |
||
32 | } |
||
33 | |||
34 | if ($definition->getClass() !== PdoAdapter::class) { |
||
35 | continue; |
||
36 | } |
||
37 | |||
38 | $cacheAdaptersReferences[] = new Reference($id); |
||
39 | } |
||
40 | |||
41 | $container->getDefinition($subscriberId) |
||
42 | ->replaceArgument(0, $cacheAdaptersReferences); |
||
43 | } |
||
44 | } |
||
45 |