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