Code Duplication    Length = 5-5 lines in 2 locations

src/Filesystem/FilesystemStorage.php 2 locations

@@ 45-49 (lines=5) @@
42
            throw new ReadException(sprintf('Cannot read %s: Is a directory.', $path));
43
        }
44
45
        if (false === ($contents = @file_get_contents($path))) {
46
            $error = error_get_last();
47
48
            throw new ReadException(sprintf('Could not read %s: %s.', $path, $error['message']));
49
        }
50
51
        return $contents;
52
    }
@@ 70-74 (lines=5) @@
67
            $filesystem->mkdir($dir);
68
        }
69
70
        if (false === ($numBytes = @file_put_contents($path, $contents))) {
71
            $error = error_get_last();
72
73
            throw new ReadException(sprintf('Could not write %s: %s.', $path, $error['message']));
74
        }
75
76
        return $numBytes;
77
    }