Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function process(ContainerBuilder $container) |
||
22 | { |
||
23 | if (!$container->hasDefinition(self::REGISTRY_DEFINITION_ID)) { |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | $definition = $container->getDefinition(self::REGISTRY_DEFINITION_ID); |
||
28 | foreach ($container->findTaggedServiceIds(self::TAG_NAME) as $id => $attributes) { |
||
29 | foreach ($attributes as $attribute) { |
||
30 | if (!isset($attribute['type'])) { |
||
31 | throw new LogicException(self::TAG_NAME . ' service tag needs a "type" attribute to identify the placeholder provider type. None given.'); |
||
32 | } |
||
33 | |||
34 | $definition->addMethodCall( |
||
35 | 'addProvider', |
||
36 | [$attribute['type'], new Reference($id)] |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 |