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