@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | private static $cache; |
16 | 16 | |
17 | 17 | private static function cache() { |
18 | - if(isset(self::$cache) || ! Schema::hasTable('modules')) return; |
|
18 | + if (isset(self::$cache) || !Schema::hasTable('modules')) return; |
|
19 | 19 | |
20 | - self::$cache = Schema::hasTable('modules')? self::pluck('class', 'alias'): collect(); |
|
20 | + self::$cache = Schema::hasTable('modules') ? self::pluck('class', 'alias') : collect(); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public static function isInstalled($classOrAlias) { |
24 | - return self::getClass($classOrAlias)? 1: 0; |
|
24 | + return self::getClass($classOrAlias) ? 1 : 0; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public static function getClass($classOrAlias) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public static function getInstalled() { |
36 | 36 | self::cache(); |
37 | 37 | |
38 | - return self::$cache?: collect(); |
|
38 | + return self::$cache ?: collect(); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | { |
49 | 49 | $ret = []; |
50 | 50 | foreach (self::getInstalled() as $module) { |
51 | - if (! $list = $module::$method()) continue; |
|
51 | + if (!$list = $module::$method()) continue; |
|
52 | 52 | |
53 | - $ret = array_merge($ret, is_array($list)? $list: [$list]); |
|
53 | + $ret = array_merge($ret, is_array($list) ? $list : [$list]); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $ret; |
@@ -15,7 +15,9 @@ discard block |
||
15 | 15 | private static $cache; |
16 | 16 | |
17 | 17 | private static function cache() { |
18 | - if(isset(self::$cache) || ! Schema::hasTable('modules')) return; |
|
18 | + if(isset(self::$cache) || ! Schema::hasTable('modules')) { |
|
19 | + return; |
|
20 | + } |
|
19 | 21 | |
20 | 22 | self::$cache = Schema::hasTable('modules')? self::pluck('class', 'alias'): collect(); |
21 | 23 | } |
@@ -27,7 +29,9 @@ discard block |
||
27 | 29 | public static function getClass($classOrAlias) { |
28 | 30 | self::cache(); |
29 | 31 | |
30 | - if (self::$cache->contains($classOrAlias)) return $classOrAlias; |
|
32 | + if (self::$cache->contains($classOrAlias)) { |
|
33 | + return $classOrAlias; |
|
34 | + } |
|
31 | 35 | |
32 | 36 | return self::$cache[$classOrAlias]?? null; |
33 | 37 | } |
@@ -48,7 +52,9 @@ discard block |
||
48 | 52 | { |
49 | 53 | $ret = []; |
50 | 54 | foreach (self::getInstalled() as $module) { |
51 | - if (! $list = $module::$method()) continue; |
|
55 | + if (! $list = $module::$method()) { |
|
56 | + continue; |
|
57 | + } |
|
52 | 58 | |
53 | 59 | $ret = array_merge($ret, is_array($list)? $list: [$list]); |
54 | 60 | } |