| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 4 | private function createDirectory($path) |
|
| 33 | { |
||
| 34 | 4 | if (is_dir($path)) { |
|
| 35 | 1 | $this->output->writeln(sprintf('The <comment>%s</comment> directory already exists', $path)); |
|
| 36 | |||
| 37 | 1 | return; |
|
| 38 | } |
||
| 39 | |||
| 40 | 4 | $this->output->writeln(sprintf('Creating the <comment>%s</comment> directory', $path)); |
|
| 41 | |||
| 42 | 4 | if (!@mkdir($path, 0777, true) && !@is_dir($path)) { |
|
| 43 | 1 | throw new \RuntimeException(sprintf('Failed to create the "%s" directory.', $path)); |
|
| 44 | } |
||
| 45 | } |
||
| 46 | } |