Total Complexity | 6 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 92.31% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | final class RoachCompilerPass implements CompilerPassInterface |
||
21 | { |
||
22 | 1 | public function process(ContainerBuilder $container): void |
|
23 | { |
||
24 | 1 | $tags = array_values(RoachPhpExtension::TAGS); |
|
25 | |||
26 | 1 | foreach ($this->iterateTags($container, $tags) as $id) { |
|
27 | $container |
||
28 | 1 | ->getDefinition($id) |
|
29 | 1 | ->setPublic(true) |
|
30 | 1 | ->setAutowired(true) |
|
31 | 1 | ->setAutoconfigured(true) |
|
32 | ; |
||
33 | } |
||
34 | |||
35 | 1 | foreach ($this->iterateTags($container, RoachPhpExtension::CLEAR_EVENT_SUBSCRIBER_TAGS) as $id) { |
|
36 | $container->getDefinition($id)->clearTag('kernel.event_subscriber'); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param array<string> $serviceTags |
||
42 | * |
||
43 | * @return \Generator<string> |
||
44 | */ |
||
45 | 1 | private function iterateTags(ContainerBuilder $container, array $serviceTags): \Generator |
|
50 | } |
||
51 | } |
||
54 |