Code Duplication    Length = 10-14 lines in 2 locations

src/DependencyInjection/Compiler/DataSourcePass.php 1 location

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

src/PostsBundle/DependencyInjection/Compiler/PostsMapPass.php 1 location

@@ 9-18 (lines=10) @@
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class PostsMapPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        $definition = $container->getDefinition('sculpin_posts.posts_map');
14
        foreach ($container->findTaggedServiceIds('sculpin_posts.posts_map') as $id => $tagAttributes) {
15
            $definition->addMethodCall('addMap', [new Reference($id)]);
16
        }
17
    }
18
}
19