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