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

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