Code Duplication    Length = 8-8 lines in 2 locations

src/Handlers/OpenApiHandler.php 1 location

@@ 311-318 (lines=8) @@
308
        return $list;
309
    }
310
311
    private function getBasePath($handlers, $baseUrl)
312
    {
313
        $basePath = null;
314
        foreach ($handlers as $handler) {
315
            $basePath = $this->getLongestCommonSubstring($basePath, $this->apiLink->link($handler['endpoint']));
316
        }
317
        return rtrim(str_replace($baseUrl, '', $basePath), '/');
318
    }
319
320
    private function getLongestCommonSubstring($path1, $path2)
321
    {

src/Handlers/SwaggerHandler.php 1 location

@@ 254-261 (lines=8) @@
251
        return $list;
252
    }
253
254
    private function getBasePath($handlers, $baseUrl)
255
    {
256
        $basePath = null;
257
        foreach ($handlers as $handler) {
258
            $basePath = $this->getLongestCommonSubstring($basePath, $this->apiLink->link($handler['endpoint']));
259
        }
260
        return rtrim(str_replace($baseUrl, '', $basePath), '/');
261
    }
262
263
    private function getLongestCommonSubstring($path1, $path2)
264
    {