| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 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 | } |
||
| 64 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.