Passed
Push — master ( 836088...195422 )
by Georgi
02:55
created
src/System/Integration/Modules/ModuleManager.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public static function isInstalled($classOrAlias)
21 21
 	{
22
-		return self::getClass($classOrAlias, true)? 1: 0;
22
+		return self::getClass($classOrAlias, true) ? 1 : 0;
23 23
 	}
24 24
 	
25 25
 	public static function isAvalable($classOrAlias)
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return string;
35 35
 	 */
36 36
 	public static function getClass($classOrAlias, $installedOnly = false) {
37
-		$modules = $installedOnly? self::getInstalled(): self::getAll();
37
+		$modules = $installedOnly ? self::getInstalled() : self::getAll();
38 38
 		
39 39
 		if (collect($modules)->contains($classOrAlias)) return $classOrAlias;
40 40
 		
@@ -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
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public static function collect($method, $args = [])
123 123
 	{
124
-		$args = is_array($args)? $args: [$args];
124
+		$args = is_array($args) ? $args : [$args];
125 125
 		
126 126
 		$installedModules = self::getInstalled();
127 127
 		
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 		
135 135
 		$ret = [];
136 136
 		foreach ($installedModules as $module) {
137
-			if (! $list = $module::$method(...$args)) continue;
137
+			if (!$list = $module::$method(...$args)) continue;
138 138
 			
139
-			$ret = array_merge($ret, is_array($list)? $list: [$list]);
139
+			$ret = array_merge($ret, is_array($list) ? $list : [$list]);
140 140
 		}
141 141
 		
142 142
 		return $ret;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			return true;
156 156
 		}
157 157
 		
158
-		if (! $moduleClass = self::getClass($classOrAlias)) {			
158
+		if (!$moduleClass = self::getClass($classOrAlias)) {			
159 159
 			throw new \Exception('Module "' . $classOrAlias . '" could not be identified');
160 160
 		}
161 161
 		
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 			$parentModule = array_shift($unsatisfiedDependencies);
207 207
 				
208 208
 			if (self::$processing[$parentModule]?? false) {
209
-				throw new Exception('Cross dependency: '. $parentModule);
209
+				throw new Exception('Cross dependency: ' . $parentModule);
210 210
 			}
211 211
 				
212
-			if (! self::isAvalable($parentModule)) {
212
+			if (!self::isAvalable($parentModule)) {
213 213
 				throw new Exception('Module not found: "' . $parentModule . '"');
214 214
 			}
215 215
 	
@@ -230,13 +230,13 @@  discard block
 block discarded – undo
230 230
 	
231 231
 	public static function uninstall($classOrAlias)
232 232
 	{
233
-		if (! self::isInstalled($classOrAlias)) {
233
+		if (!self::isInstalled($classOrAlias)) {
234 234
 			print ('Module "' . $classOrAlias . '" is not installed!');
235 235
 			
236 236
 			return true;
237 237
 		}
238 238
 		
239
-		if (! $moduleClass = self::getClass($classOrAlias)) {
239
+		if (!$moduleClass = self::getClass($classOrAlias)) {
240 240
 			throw new \Exception('Module "' . $classOrAlias . '" could not be identified');
241 241
 		}
242 242
 		
Please login to merge, or discard this patch.