Code Duplication    Length = 16-16 lines in 2 locations

src/DependencyInjection/Compiler/DataProviderManagerPass.php 1 location

@@ 18-33 (lines=16) @@
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class DataProviderManagerPass implements CompilerPassInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function process(ContainerBuilder $container)
24
    {
25
        $definition = $container->getDefinition('sculpin.data_provider_manager');
26
27
        foreach ($container->findTaggedServiceIds('sculpin.data_provider') as $id => $tagAttributes) {
28
            foreach ($tagAttributes as $attributes) {
29
                $definition->addMethodCall('registerDataProvider', [$attributes['alias'], new Reference($id)]);
30
            }
31
        }
32
    }
33
}
34

src/DependencyInjection/Compiler/GeneratorManagerPass.php 1 location

@@ 18-33 (lines=16) @@
15
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class GeneratorManagerPass implements CompilerPassInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function process(ContainerBuilder $container)
24
    {
25
        $definition = $container->getDefinition('sculpin.generator_manager');
26
27
        foreach ($container->findTaggedServiceIds('sculpin.generator') as $id => $tagAttributes) {
28
            foreach ($tagAttributes as $attributes) {
29
                $definition->addMethodCall('registerGenerator', [$attributes['alias'], new Reference($id)]);
30
            }
31
        }
32
    }
33
}
34