Conditions | 4 |
Paths | 4 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function process(ContainerBuilder $container) |
||
21 | { |
||
22 | $taggedServices = $container->findTaggedServiceIds( |
||
23 | 'guzzle.client' |
||
24 | ); |
||
25 | |||
26 | $definitions = []; |
||
27 | foreach ($taggedServices as $id => $tags) { |
||
28 | foreach ($tags as $attributes) { |
||
29 | $definitionId = sprintf('guzzle_client.%s', $attributes['alias']); |
||
30 | if (!$container->has($definitionId)) { |
||
31 | $definition = new Definition(); |
||
32 | $definition->setClass('Guzzle\ConfigOperationsBundle\GuzzleClient'); |
||
33 | $definition->setFactory([ |
||
34 | new Reference('guzzle_config_operations.factory'), |
||
35 | 'getClient' |
||
36 | ]); |
||
37 | $definition->setPublic(true); |
||
38 | $definition->addArgument($id); |
||
39 | $definitions[$definitionId] = $definition; |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 | |||
44 | $container->addDefinitions($definitions); |
||
45 | } |
||
46 | } |
||
47 |