Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Utils |
||
11 | { |
||
12 | /** |
||
13 | * @param Definition $definition |
||
14 | * @param int $index |
||
15 | * @param mixed $value |
||
16 | * |
||
17 | * @throws OutOfBoundsException |
||
18 | */ |
||
19 | 13 | public static function addOrReplaceDefinitionArgument(Definition $definition, int $index, $value): void |
|
20 | { |
||
21 | 13 | if (array_key_exists($index, $definition->getArguments())) { |
|
22 | $definition->replaceArgument($index, $value); |
||
23 | } else { |
||
24 | 13 | $definition->setArgument($index, $value); |
|
25 | } |
||
26 | 13 | } |
|
27 | |||
28 | /** |
||
29 | * @param Definition $definition |
||
30 | */ |
||
31 | 5 | public static function clearListenerTags(Definition $definition): void |
|
37 | 5 | } |
|
38 | } |
||
39 |