Code Duplication    Length = 13-13 lines in 2 locations

src/Chain/ContainerMiddlewareChain.php 1 location

@@ 39-51 (lines=13) @@
36
    /**
37
     * @param string $service
38
     */
39
    public function registerService($service)
40
    {
41
        $index = array_search($service, $this->middleware_handler_ids);
42
43
        // move existing middleware to end of chain
44
        if ($index !== false) {
45
            unset($this->middleware_handler_ids[$index]);
46
            // correct array indexes
47
            $this->middleware_handler_ids = array_values($this->middleware_handler_ids);
48
        }
49
50
        $this->middleware_handler_ids[] = $service;
51
    }
52
53
    /**
54
     * @param mixed $message

src/Chain/SymfonyContainerMiddlewareChain.php 1 location

@@ 30-42 (lines=13) @@
27
    /**
28
     * @param string $service
29
     */
30
    public function registerService($service)
31
    {
32
        $index = array_search($service, $this->middleware_handler_ids);
33
34
        // move existing middleware to end of chain
35
        if ($index !== false) {
36
            unset($this->middleware_handler_ids[$index]);
37
            // correct array indexes
38
            $this->middleware_handler_ids = array_values($this->middleware_handler_ids);
39
        }
40
41
        $this->middleware_handler_ids[] = $service;
42
    }
43
44
    /**
45
     * @param mixed $message