Conditions | 5 |
Paths | 12 |
Total Lines | 28 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
39 | protected function createService( |
||
40 | ContainerBuilder $container, |
||
41 | $id, |
||
42 | $class, |
||
43 | $argumentList = [], |
||
44 | $tagList = [], |
||
45 | $addMethodCallList = [], |
||
46 | $factory = null |
||
47 | ) { |
||
48 | $definition = new Definition($class, $argumentList); |
||
49 | |||
50 | foreach ($tagList as $tag) { |
||
51 | $definition->addTag($tag); |
||
52 | } |
||
53 | |||
54 | foreach ($addMethodCallList as $methodCall) { |
||
55 | $args = isset($methodCall[1]) ? $methodCall[1] : []; |
||
56 | $definition->addMethodCall($methodCall[0], $args); |
||
57 | } |
||
58 | |||
59 | if (null !== $factory) { |
||
60 | $definition->setFactory($factory); |
||
61 | } |
||
62 | |||
63 | $container->setDefinition($this->buildContainerId($id), $definition); |
||
64 | |||
65 | return $definition; |
||
66 | } |
||
67 | } |
||
68 |