Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
29 | 60 | public function handle($dirname, $mode, $options) |
|
30 | { |
||
31 | 60 | $dirname = Util::normalizePath($dirname); |
|
32 | |||
33 | 60 | $adapter = $this->filesystem->getAdapter(); |
|
34 | |||
35 | // If recursive, or a single level directory, just create it. |
||
36 | 60 | if (($options & STREAM_MKDIR_RECURSIVE) || strpos($dirname, '/') === false) { |
|
37 | 54 | return (bool) $adapter->createDir($dirname, $this->defaultConfig()); |
|
38 | } |
||
39 | |||
40 | 18 | if ( ! $adapter->has(dirname($dirname))) { |
|
41 | 12 | throw new FileNotFoundException($dirname); |
|
42 | } |
||
43 | |||
44 | 12 | return (bool) $adapter->createDir($dirname, $this->defaultConfig()); |
|
45 | } |
||
46 | } |
||
47 |