Total Complexity | 8 |
Total Lines | 75 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class LaravelHelpers |
||
12 | { |
||
13 | /** |
||
14 | * Return the alphabet in array form. |
||
15 | * |
||
16 | * @return array |
||
17 | */ |
||
18 | public static function alphabet() |
||
19 | { |
||
20 | return Cache::rememberForever('alphabet', function () { |
||
21 | return range('A', 'Z'); |
||
22 | }); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Return the index of a letter in the alphabet. |
||
27 | * |
||
28 | * @param int $index |
||
29 | * @return string |
||
30 | */ |
||
31 | public static function alphabetIndex($index) |
||
32 | { |
||
33 | return self::alphabet()[$index]; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Retrieve a class's short name (without namespace). |
||
38 | * |
||
39 | * @param $class |
||
40 | * @param bool $short Full name or short name |
||
41 | * @param string|null $default |
||
42 | * @return string |
||
43 | */ |
||
44 | public static function getClassName($class, $short = false, $default = null) |
||
54 | } |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Determine if the Application is running in a 'production' environment. |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public static function isProductionEnvironment() |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Determine if the Application is running in a 'development' environment. |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | public static function isDevelopmentEnvironment() |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Serialize and simple hash a value to create a unique ID. |
||
79 | * |
||
80 | * @param $value |
||
81 | * @return int |
||
82 | */ |
||
83 | public static function serializeHash($value) |
||
88 |