Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
48 | public static function ensureDirectory($dir, $mode = 0777) |
||
49 | { |
||
50 | $old = error_reporting(0); |
||
51 | |||
52 | if (@is_dir($dir)) { |
||
53 | return; |
||
54 | } |
||
55 | |||
56 | if (! @mkdir($dir, $mode, true) && ! @is_dir($dir)) { |
||
57 | error_reporting($old); |
||
58 | throw new \RuntimeException('Could not create directory'); |
||
59 | } |
||
60 | |||
61 | error_reporting($old); |
||
62 | } |
||
63 | } |
||
64 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.