Code Duplication    Length = 6-7 lines in 2 locations

src/Route/Route.php 2 locations

@@ 118-124 (lines=7) @@
115
        string $path = null,
116
        ContainerInterface $di = null
117
    ) {
118
        if ($this->mount) {
119
            // Remove the mount path to get base for controller
120
            $len = strlen($this->mount);
121
            if (substr($path, 0, $len) == $this->mount) {
122
                $path = ltrim(substr($path, $len), "/");
123
            }
124
        }
125
126
        $handler = new RouteHandler();
127
        return $handler->handle($this->methodMatched, $path, $this->handler, $this->arguments, $di);
@@ 141-146 (lines=6) @@
138
    public function getMatchedPath()
139
    {
140
        $path = $this->pathMatched;
141
        if ($this->mount) {
142
            $len = strlen($this->mount);
143
            if (substr($path, 0, $len) == $this->mount) {
144
                $path = ltrim(substr($path, $len), "/");
145
            }
146
        }
147
148
        return $path;
149
    }