Code Duplication    Length = 9-9 lines in 2 locations

DependencyInjection/Compiler/CustomHandlersPass.php 2 locations

@@ 33-41 (lines=9) @@
30
                    $directions = array(constant($directionConstant));
31
                }
32
33
                foreach ($directions as $direction) {
34
                    $method = isset($attrs['method']) ? $attrs['method'] : HandlerRegistry::getDefaultMethod($direction, $attrs['type'], $attrs['format']);
35
                    if (class_exists(ServiceLocatorTagPass::class) || $container->getDefinition($id)->isPublic()) {
36
                        $handlerServices[$id] = new Reference($id);
37
                        $handlers[$direction][$attrs['type']][$attrs['format']] = array($id, $method);
38
                    } else {
39
                        $handlers[$direction][$attrs['type']][$attrs['format']] = array(new Reference($id), $method);
40
                    }
41
                }
42
            }
43
        }
44
@@ 62-70 (lines=9) @@
59
                    $directions = array($methodData['direction']);
60
                }
61
62
                foreach ($directions as $direction) {
63
                    $method = isset($methodData['method']) ? $methodData['method'] : HandlerRegistry::getDefaultMethod($direction, $methodData['type'], $methodData['format']);
64
                    if (class_exists(ServiceLocatorTagPass::class) || $container->getDefinition($id)->isPublic()) {
65
                        $handlerServices[$id] = new Reference($id);
66
                        $handlers[$direction][$methodData['type']][$methodData['format']] = array($id, $method);
67
                    } else {
68
                        $handlers[$direction][$methodData['type']][$methodData['format']] = array(new Reference($id), $method);
69
                    }
70
                }
71
            }
72
        }
73