| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | protected function writeFile(array $path, string $data): void |
||
| 19 | { |
||
| 20 | if (!is_dir($path[0])) { |
||
| 21 | mkdir($path[0], 0755, true); |
||
| 22 | } |
||
| 23 | |||
| 24 | $fullPath = $path[0] . $path[1]; |
||
| 25 | |||
| 26 | if (!file_exists($fullPath)) { |
||
| 27 | Cli::printer("The file ", "light_green"); |
||
| 28 | Cli::printer($fullPath, "light_green"); |
||
| 29 | Cli::printer(" was created" . PHP_EOL, "light_green"); |
||
| 30 | file_put_contents($fullPath, $data); |
||
| 31 | } else { |
||
| 32 | Cli::printer("The file $fullPath is already exists" . PHP_EOL, "light_yellow"); |
||
| 33 | } |
||
| 36 |