Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 8.1239 |
Changes | 0 |
1 | <?php |
||
13 | 3 | public function process(ContainerBuilder $container) |
|
14 | { |
||
15 | 3 | $clients = $container->findTaggedServiceIds(self::CLIENT_TAG); |
|
16 | |||
17 | 3 | foreach ($clients as $clientId => $tags) { |
|
18 | if (count($tags) > 1) { |
||
19 | throw new \LogicException(sprintf('Clients should use a single \'%s\' tag', self::CLIENT_TAG)); |
||
20 | } |
||
21 | |||
22 | $clientDefinition = $container->findDefinition($clientId); |
||
23 | if (isset($tags[0]['no_dispatcher']) === false) { |
||
24 | $clientDefinition->addMethodCall( |
||
25 | 'setDispatcher', |
||
26 | [ |
||
27 | new Reference($container->getParameter('freshcells_soap_client.event_dispatcher.service')) |
||
28 | ] |
||
29 | ); |
||
30 | } |
||
31 | } |
||
32 | 3 | } |
|
33 | } |
||
34 |