Passed
Push — master ( e70760...901a0b )
by Georgi
03:05
created
src/System/Integration/Modules/ModuleManager.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 	public static function isInstalled($classOrAlias)
20 20
 	{
21
-		return self::getClass($classOrAlias)? 1: 0;
21
+		return self::getClass($classOrAlias) ? 1 : 0;
22 22
 	}
23 23
 	
24 24
 	public static function isAvalable($classOrAlias)
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @return string;
34 34
 	 */
35 35
 	public static function getClass($classOrAlias, $installed = false) {
36
-		$allModules = $installed? self::getInstalled(): self::getAll();
36
+		$allModules = $installed ? self::getInstalled() : self::getAll();
37 37
 		
38 38
 		if (collect($allModules)->contains($classOrAlias)) return $classOrAlias;
39 39
 		
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	public static function getInstalled()
49 49
 	{
50 50
 		return self::$installed = self::$installed?? self::getCached('epesi-modules-installed', function() {
51
-			$installedModules = Schema::hasTable('modules')? Module::pluck('class', 'alias'): collect();
51
+			$installedModules = Schema::hasTable('modules') ? Module::pluck('class', 'alias') : collect();
52 52
 			
53 53
 			// if epesi is not installed fake having the system module to enable its functionality
54 54
 			if ($installedModules->isEmpty()) {
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function getAll()
68 68
 	{
69
-		return self::getCached('epesi-modules-available', function () {
69
+		return self::getCached('epesi-modules-available', function() {
70 70
 			$modules = collect();
71
-			foreach (array_merge(config('epesi.modules', []), self::packageManifest()->modules()?: []) as $moduleClass) {
71
+			foreach (array_merge(config('epesi.modules', []), self::packageManifest()->modules() ?: []) as $moduleClass) {
72 72
 				$modules->add(['alias' => $moduleClass::alias(), 'class' => $moduleClass]);
73 73
 			}
74 74
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	protected static function getCached($key, \Closure $default)
87 87
 	{
88
-		if (! Cache::has($key)) {
88
+		if (!Cache::has($key)) {
89 89
 			Cache::forever($key, $default());
90 90
 		}
91 91
 
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public static function collect($method, $args = [])
111 111
 	{
112
-		$args = is_array($args)? $args: [$args];
112
+		$args = is_array($args) ? $args : [$args];
113 113
 		
114 114
 		$ret = [];
115 115
 		foreach (self::getInstalled() as $module) {
116
-			if (! $list = $module::$method(...$args)) continue;
116
+			if (!$list = $module::$method(...$args)) continue;
117 117
 			
118
-			$ret = array_merge($ret, is_array($list)? $list: [$list]);
118
+			$ret = array_merge($ret, is_array($list) ? $list : [$list]);
119 119
 		}
120 120
 		
121 121
 		return $ret;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			return true;
135 135
 		}
136 136
 		
137
-		if (! $moduleClass = self::getClass($classOrAlias)) {			
137
+		if (!$moduleClass = self::getClass($classOrAlias)) {			
138 138
 			throw new \Exception('Module "' . $classOrAlias . '" could not be identified');
139 139
 		}
140 140
 		
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 				$parentModule = $unsatisfiedDependencies[0];
187 187
 				
188 188
 				if (self::$processing[$moduleClass]?? false) {
189
-					throw new \Exception('Cross dependency: '. $moduleClass);
189
+					throw new \Exception('Cross dependency: ' . $moduleClass);
190 190
 				}
191 191
 				
192
-				if (! self::isAvalable($parentModule)) {
192
+				if (!self::isAvalable($parentModule)) {
193 193
 					throw new \Exception('Module not found: "' . $parentModule . '"');
194 194
 				}
195 195
 	
Please login to merge, or discard this patch.