| Total Complexity | 7 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | abstract class BaseUtil |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Use this method to soothe warning of your IDE like "unused parameter" |
||
| 19 | * |
||
| 20 | * @param array ...$args |
||
| 21 | */ |
||
| 22 | 1 | public static function noop(... $args) |
|
| 24 | 1 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @param int $length |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | 8 | public static function createRandomToken($length = 10) |
|
| 32 | { |
||
| 33 | 8 | $result = ''; |
|
| 34 | |||
| 35 | 8 | while (\strlen($result) < $length) { |
|
| 36 | 7 | $result .= str_replace('.', '', uniqid('', true)); |
|
| 37 | } |
||
| 38 | |||
| 39 | 8 | return \substr($result, 0, $length); |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $dir |
||
| 44 | * @param int $mode |
||
| 45 | * |
||
| 46 | * @codeCoverageIgnore |
||
| 47 | */ |
||
| 48 | public static function ensureDirectory($dir, $mode = 0777) |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.