Code Duplication    Length = 16-16 lines in 3 locations

DependencyInjection/Compiler/AlgorithmCompilerPass.php 1 location

@@ 18-33 (lines=16) @@
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class AlgorithmCompilerPass implements CompilerPassInterface
19
{
20
    public function process(ContainerBuilder $container)
21
    {
22
        if (!$container->hasDefinition('jose.algorithm_manager')) {
23
            return;
24
        }
25
26
        $definition = $container->getDefinition('jose.algorithm_manager');
27
28
        $taggedServices = $container->findTaggedServiceIds('jose.algorithm');
29
        foreach ($taggedServices as $id => $tags) {
30
            $definition->addMethodCall('addAlgorithm', [new Reference($id)]);
31
        }
32
    }
33
}
34

DependencyInjection/Compiler/CheckerCompilerPass.php 1 location

@@ 18-33 (lines=16) @@
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class CheckerCompilerPass implements CompilerPassInterface
19
{
20
    public function process(ContainerBuilder $container)
21
    {
22
        if (!$container->hasDefinition('jose.checker_manager')) {
23
            return;
24
        }
25
26
        $definition = $container->getDefinition('jose.checker_manager');
27
28
        $taggedServices = $container->findTaggedServiceIds('jose_checker');
29
        foreach ($taggedServices as $id => $tags) {
30
            $definition->addMethodCall('addChecker', [new Reference($id)]);
31
        }
32
    }
33
}
34

DependencyInjection/Compiler/CompressionCompilerPass.php 1 location

@@ 18-33 (lines=16) @@
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
final class CompressionCompilerPass implements CompilerPassInterface
19
{
20
    public function process(ContainerBuilder $container)
21
    {
22
        if (!$container->hasDefinition('jose.compression_manager')) {
23
            return;
24
        }
25
26
        $definition = $container->getDefinition('jose.compression_manager');
27
28
        $taggedServices = $container->findTaggedServiceIds('jose.compression');
29
        foreach ($taggedServices as $id => $tags) {
30
            $definition->addMethodCall('addCompressionMethod', [new Reference($id)]);
31
        }
32
    }
33
}
34