Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | public function process(ContainerBuilder $container) |
||
15 | { |
||
16 | $factory = $container->findDefinition('terox.subscription.registry'); |
||
17 | $strategyServiceIds = array_keys($container->findTaggedServiceIds('subscription.strategy')); |
||
18 | |||
19 | // Add subscription strategies to factory instance |
||
20 | foreach ($strategyServiceIds as $strategyServiceId) { |
||
21 | $strategy = $container->findDefinition($strategyServiceId); |
||
22 | $tag = $strategy->getTag('subscription.strategy'); |
||
23 | |||
24 | if ('subscription' !== $tag[0]['type']) { |
||
25 | continue; |
||
26 | } |
||
27 | |||
28 | $factory->addMethodCall('addStrategy', [new Reference($strategyServiceId), $tag[0]['strategy']]); |
||
29 | } |
||
32 |