1 | <?php |
||
5 | class Filesystem |
||
6 | { |
||
7 | /** @var string */ |
||
8 | private $basePath; |
||
9 | |||
10 | public function __construct(string $basePath) |
||
14 | |||
15 | public static function inDirectory(string $path): self |
||
19 | |||
20 | public function path(string $filename): string |
||
24 | |||
25 | public function has(string $filename): bool |
||
29 | |||
30 | /** |
||
31 | * Get all file names in this directory that have the same name |
||
32 | * as $fileName, but have a different file extension. |
||
33 | * |
||
34 | * @param string $fileName |
||
35 | * |
||
36 | * @return array |
||
37 | */ |
||
38 | public function getNamesWithDifferentExtension(string $fileName) |
||
60 | |||
61 | public function read(string $filename): string |
||
65 | |||
66 | public function put(string $filename, string $contents) |
||
74 | |||
75 | public function delete(string $fileName) |
||
79 | |||
80 | public function copy(string $filePath, string $fileName) |
||
88 | |||
89 | public function fileEquals(string $filePath, string $fileName) |
||
93 | } |
||
94 |