Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class Utilities |
||
16 | { |
||
17 | /** |
||
18 | * round a number to nearest even number |
||
19 | * |
||
20 | * @param float $number |
||
21 | * @return int |
||
22 | */ |
||
23 | public static function roundToEven(float $number): int |
||
24 | { |
||
25 | return (($number = intval($number)) % 2 == 0) ? $number : $number + 1; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param int $length |
||
30 | * @return bool|string |
||
31 | */ |
||
32 | public static function randomString($length = 10) |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @param $word |
||
40 | * @return bool|string |
||
41 | */ |
||
42 | public static function appendSlash(string $word) |
||
45 | } |
||
46 | } |