| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function write(string $path, string $content): void |
||
| 34 | { |
||
| 35 | $dir = dirname($path); |
||
| 36 | |||
| 37 | if (false === is_dir($dir)) { |
||
| 38 | mkdir($dir, 0777, true); |
||
| 39 | } |
||
| 40 | |||
| 41 | if (true === $this->overwrite || false === file_exists($path)) { |
||
| 42 | file_put_contents($path, $content); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->overwrite = false; |
||
| 46 | } |
||
| 48 |