Code Duplication    Length = 11-11 lines in 3 locations

src/PathMappingRepository.php 1 location

@@ 55-65 (lines=11) @@
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function get($path)
56
    {
57
        $path = $this->sanitizePath($path);
58
        $filesystemPaths = $this->resolveFilesystemPaths($path);
59
60
        if (0 === count($filesystemPaths)) {
61
            throw ResourceNotFoundException::forPath($path);
62
        }
63
64
        return $this->createResource(reset($filesystemPaths), $path);
65
    }
66
67
    /**
68
     * {@inheritdoc}

src/FilesystemRepository.php 2 locations

@@ 144-154 (lines=11) @@
141
    /**
142
     * {@inheritdoc}
143
     */
144
    public function get($path)
145
    {
146
        $path = $this->sanitizePath($path);
147
        $filesystemPath = $this->baseDir.$path;
148
149
        if (!file_exists($filesystemPath)) {
150
            throw ResourceNotFoundException::forPath($path);
151
        }
152
153
        return $this->createResource($filesystemPath, $path);
154
    }
155
156
    /**
157
     * {@inheritdoc}
@@ 442-452 (lines=11) @@
439
        return new FilesystemResourceCollection($resources);
440
    }
441
442
    private function getFilesystemPath($path)
443
    {
444
        $path = $this->sanitizePath($path);
445
        $filesystemPath = $this->baseDir.$path;
446
447
        if (!file_exists($filesystemPath)) {
448
            throw ResourceNotFoundException::forPath($path);
449
        }
450
451
        return $filesystemPath;
452
    }
453
454
    private function getGlobIterator($query, $language)
455
    {