Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
10 | class Writer |
||
11 | { |
||
12 | /** |
||
13 | * Write a file object to the filesystem and return the created path |
||
14 | * |
||
15 | * @param File $file |
||
16 | * |
||
17 | * @return string |
||
18 | * @throws DoctrineStaticMetaException |
||
19 | */ |
||
20 | public function write(File $file): string |
||
21 | { |
||
22 | $this->createDirectoryIfRequired($file); |
||
23 | $file->create(); |
||
24 | $file->putContents(); |
||
25 | |||
26 | return $file->getPath(); |
||
27 | } |
||
28 | |||
29 | private function createDirectoryIfRequired(File $file): void |
||
34 | } |
||
35 | } |
||
37 |