1 | <?php |
||
10 | class FileSystemWriter implements FileSystemWriterInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var FileSystemPathInterface |
||
14 | */ |
||
15 | private $path; |
||
16 | |||
17 | /** |
||
18 | * FileSystemWriter constructor. |
||
19 | * @param FileSystemPathInterface $path |
||
20 | */ |
||
21 | 2 | public function __construct(FileSystemPathInterface $path) |
|
25 | |||
26 | /** |
||
27 | * @inheritDoc |
||
28 | */ |
||
29 | 1 | public function isWritable(): bool |
|
33 | |||
34 | /** |
||
35 | * @inheritDoc |
||
36 | */ |
||
37 | 1 | public function write(string $content) |
|
42 | |||
43 | /** |
||
44 | * @return bool |
||
45 | */ |
||
46 | 1 | private function isWritablePath() |
|
50 | |||
51 | /** |
||
52 | * @throws FileSystemException |
||
53 | * @throws InvalidPathException |
||
54 | */ |
||
55 | 4 | private function validate() |
|
61 | |||
62 | /** |
||
63 | * @throws InvalidPathException |
||
64 | */ |
||
65 | 3 | private function validateIsDirectory() |
|
71 | |||
72 | /** |
||
73 | * @throws FileSystemException |
||
74 | */ |
||
75 | 2 | private function validatePathIsWritable() |
|
81 | |||
82 | /** |
||
83 | * @throws FileSystemException |
||
84 | */ |
||
85 | 2 | private function validateWritableFile() |
|
91 | } |
||
92 |