@@ 18-41 (lines=24) @@ | ||
15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
16 | use Symfony\Component\DependencyInjection\Reference; |
|
17 | ||
18 | class DependencyManagerCompilerPass implements CompilerPassInterface |
|
19 | { |
|
20 | /** |
|
21 | * Process compiler. |
|
22 | * |
|
23 | * @param ContainerBuilder $container |
|
24 | */ |
|
25 | public function process(ContainerBuilder $container) |
|
26 | { |
|
27 | if (!$container->has('packy.dependency_managers')) { |
|
28 | return; |
|
29 | } |
|
30 | ||
31 | $definition = $container->findDefinition('packy.dependency_managers'); |
|
32 | ||
33 | $taggedServices = $container->findTaggedServiceIds('packy_dependency_manager'); |
|
34 | ||
35 | foreach ($taggedServices as $id => $tags) { |
|
36 | foreach ($tags as $attributes) { |
|
37 | $definition->addMethodCall('add', [new Reference($id), $attributes["alias"]]); |
|
38 | } |
|
39 | } |
|
40 | } |
|
41 | } |
|
42 |
@@ 18-41 (lines=24) @@ | ||
15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
16 | use Symfony\Component\DependencyInjection\Reference; |
|
17 | ||
18 | class PackageManagerCompilerPass implements CompilerPassInterface |
|
19 | { |
|
20 | /** |
|
21 | * Process compiler. |
|
22 | * |
|
23 | * @param ContainerBuilder $container |
|
24 | */ |
|
25 | public function process(ContainerBuilder $container) |
|
26 | { |
|
27 | if (!$container->has('packy.package_managers')) { |
|
28 | return; |
|
29 | } |
|
30 | ||
31 | $definition = $container->findDefinition('packy.package_managers'); |
|
32 | ||
33 | $taggedServices = $container->findTaggedServiceIds('packy_package_manager'); |
|
34 | ||
35 | foreach ($taggedServices as $id => $tags) { |
|
36 | foreach ($tags as $attributes) { |
|
37 | $definition->addMethodCall('add', [new Reference($id), $attributes["alias"]]); |
|
38 | } |
|
39 | } |
|
40 | } |
|
41 | } |
|
42 |
@@ 18-41 (lines=24) @@ | ||
15 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
16 | use Symfony\Component\DependencyInjection\Reference; |
|
17 | ||
18 | class RepositoryManagerCompilerPass implements CompilerPassInterface |
|
19 | { |
|
20 | /** |
|
21 | * Process compiler. |
|
22 | * |
|
23 | * @param ContainerBuilder $container |
|
24 | */ |
|
25 | public function process(ContainerBuilder $container) |
|
26 | { |
|
27 | if (!$container->has('packy.repository_managers')) { |
|
28 | return; |
|
29 | } |
|
30 | ||
31 | $definition = $container->findDefinition('packy.repository_managers'); |
|
32 | ||
33 | $taggedServices = $container->findTaggedServiceIds('packy_repository_manager'); |
|
34 | ||
35 | foreach ($taggedServices as $id => $tags) { |
|
36 | foreach ($tags as $attributes) { |
|
37 | $definition->addMethodCall('add', [new Reference($id), $attributes["alias"]]); |
|
38 | } |
|
39 | } |
|
40 | } |
|
41 | } |
|
42 |