Passed
Push — master ( 6093b5...370e51 )
by Georgi
03:48
created
src/System/Integration/Modules/ModuleView.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
 	 */
35 35
 	final public function displayModuleContent($method, $args) {
36 36
 		// if method not callbale abort to 'not found'
37
-		if (! is_callable([$this, $method])) abort(404);
37
+		if (!is_callable([$this, $method])) abort(404);
38 38
 		
39 39
 		// if user has no access abort 'no access'
40
-		if (! $this->access()) abort(401);
40
+		if (!$this->access()) abort(401);
41 41
 		
42 42
 		$args = $this->decodeArgs($args);
43 43
 		
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,14 @@
 block discarded – undo
34 34
 	 */
35 35
 	final public function displayModuleContent($method, $args) {
36 36
 		// if method not callbale abort to 'not found'
37
-		if (! is_callable([$this, $method])) abort(404);
37
+		if (! is_callable([$this, $method])) {
38
+			abort(404);
39
+		}
38 40
 		
39 41
 		// if user has no access abort 'no access'
40
-		if (! $this->access()) abort(401);
42
+		if (! $this->access()) {
43
+			abort(401);
44
+		}
41 45
 		
42 46
 		$args = $this->decodeArgs($args);
43 47
 		
Please login to merge, or discard this patch.
src/System/Integration/Modules/ModuleCore.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	{
47 47
 		$templatesDir = static::path() . DIRECTORY_SEPARATOR . 'Templates';
48 48
 		
49
-		if (! is_dir($templatesDir)) return;
49
+		if (!is_dir($templatesDir)) return;
50 50
 		
51 51
 		$skinDir = $templatesDir . DIRECTORY_SEPARATOR . $skin;
52 52
 		
53
-		return is_dir($skinDir)? $skinDir: $templatesDir;
53
+		return is_dir($skinDir) ? $skinDir : $templatesDir;
54 54
 	}
55 55
 	
56 56
 	public static function translations()
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	{
89 89
 		$paths = $this->migrations();
90 90
 		
91
-		foreach (is_array($paths)? $paths: [$paths] as $path) {
91
+		foreach (is_array($paths) ? $paths : [$paths] as $path) {
92 92
 			\Illuminate\Support\Facades\Artisan::call('migrate', ['--path' => $path]);
93 93
 		}
94 94
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	{
98 98
 		$paths = $this->migrations();
99 99
 		
100
-		foreach (is_array($paths)? $paths: [$paths] as $path) {
100
+		foreach (is_array($paths) ? $paths : [$paths] as $path) {
101 101
 			\Illuminate\Support\Facades\Artisan::call('migrate:rollback', ['--path' => $path]);
102 102
 		}
103 103
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@
 block discarded – undo
46 46
 	{
47 47
 		$templatesDir = static::path() . DIRECTORY_SEPARATOR . 'Templates';
48 48
 		
49
-		if (! is_dir($templatesDir)) return;
49
+		if (! is_dir($templatesDir)) {
50
+			return;
51
+		}
50 52
 		
51 53
 		$skinDir = $templatesDir . DIRECTORY_SEPARATOR . $skin;
52 54
 		
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasLocation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@
 block discarded – undo
36 36
 			return $this;
37 37
 		}
38 38
 		
39
-		$this->label = is_array($this->label)? $this->label: [$this->label];
39
+		$this->label = is_array($this->label) ? $this->label : [$this->label];
40 40
 
41 41
 		$this->label = array_map('trans', $this->label);
42 42
 		
43
-		$this->location = is_array($this->location)? $this->location: [$this->location];
43
+		$this->location = is_array($this->location) ? $this->location : [$this->location];
44 44
 
45
-		return array_merge($this->label, $this->location?: []);
45
+		return array_merge($this->label, $this->location ?: []);
46 46
 	}
47 47
 	
48 48
 	public function label($label)
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasLinks.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$defaultView = self::module()::view();
21 21
 		
22
-		$viewClass = is_a(static::class, ModuleView::class, true)? static::class: $defaultView;
22
+		$viewClass = is_a(static::class, ModuleView::class, true) ? static::class : $defaultView;
23 23
 		
24 24
 		if ($viewClass == $defaultView) $viewClass = null;
25 25
 		
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	final public static function moduleLink($module, $method = 'body', $args = [])
40 40
 	{
41
-		$alias = class_exists($module)? $module::alias(): $module;
41
+		$alias = class_exists($module) ? $module::alias() : $module;
42 42
 		
43 43
 		return url(implode('/', ['view', $alias, $method, self::encodeArgs($args)]));
44 44
 	}
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	 * @throws \Illuminate\Http\Exceptions\HttpResponseException
53 53
 	 */
54 54
 	final public static function decodeArgs($hash) {
55
-		if (! $hash) return [];
55
+		if (!$hash) return [];
56 56
 		
57 57
 		$args = session($hash);
58 58
 
59 59
 		if (is_null($args)) abort(419);
60 60
 		
61
-		return is_array($args)? $args: [$args];
61
+		return is_array($args) ? $args : [$args];
62 62
 	}
63 63
 	
64 64
 	/**
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	 * @return string
69 69
 	 */
70 70
 	final public static function encodeArgs($args) {
71
-		$args = is_array($args)? $args: [$args];
71
+		$args = is_array($args) ? $args : [$args];
72 72
 		
73
-		if (! $args) return;
73
+		if (!$args) return;
74 74
 		
75 75
 		$hash = md5(serialize($args));
76 76
 		
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 		
22 22
 		$viewClass = is_a(static::class, ModuleView::class, true)? static::class: $defaultView;
23 23
 		
24
-		if ($viewClass == $defaultView) $viewClass = null;
24
+		if ($viewClass == $defaultView) {
25
+			$viewClass = null;
26
+		}
25 27
 		
26 28
 		return url(implode('/', ['view', implode('_', array_filter([self::alias(), $viewClass])), $method, self::encodeArgs($args)]));
27 29
 	}
@@ -52,11 +54,15 @@  discard block
 block discarded – undo
52 54
 	 * @throws \Illuminate\Http\Exceptions\HttpResponseException
53 55
 	 */
54 56
 	final public static function decodeArgs($hash) {
55
-		if (! $hash) return [];
57
+		if (! $hash) {
58
+			return [];
59
+		}
56 60
 		
57 61
 		$args = session($hash);
58 62
 
59
-		if (is_null($args)) abort(419);
63
+		if (is_null($args)) {
64
+			abort(419);
65
+		}
60 66
 		
61 67
 		return is_array($args)? $args: [$args];
62 68
 	}
@@ -70,7 +76,9 @@  discard block
 block discarded – undo
70 76
 	final public static function encodeArgs($args) {
71 77
 		$args = is_array($args)? $args: [$args];
72 78
 		
73
-		if (! $args) return;
79
+		if (! $args) {
80
+			return;
81
+		}
74 82
 		
75 83
 		$hash = md5(serialize($args));
76 84
 		
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/Notifies.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@
 block discarded – undo
6 6
 {
7 7
 	public function notify($options, $attachTo = null)
8 8
 	{
9
-		$options = array_merge(['duration'=> 1500], is_array($options)? $options: ['content' => $options]);
9
+		$options = array_merge(['duration'=> 1500], is_array($options) ? $options : ['content' => $options]);
10 10
 		
11
-		$attachTo = $attachTo?: $this;
11
+		$attachTo = $attachTo ?: $this;
12 12
 		
13 13
 		return (new \atk4\ui\jsNotify($options, $attachTo));
14 14
 	}
15 15
 	
16 16
 	public function notifyError($options, $attachTo = null)
17 17
 	{
18
-		$options = array_merge(['color' => 'red'], is_array($options)? $options: ['content' => $options]);
18
+		$options = array_merge(['color' => 'red'], is_array($options) ? $options : ['content' => $options]);
19 19
 		
20 20
 		return $this->notify($options, $attachTo);
21 21
 	}
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasPackageManifest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	
12 12
 	final public static function packageManifest()
13 13
 	{
14
-		return self::$packageManifest = self::$packageManifest?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath());
14
+		return self::$packageManifest = self::$packageManifest ?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath());
15 15
 	}
16 16
 	
17 17
 	final public static function getCachedManifestPath()
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasAssetsAccess.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 	}
13 13
 	
14 14
 	final public static function requireJS($file = 'default.js', $isAsync = false, $isDefer = false) {
15
-		return epesi()->requireJS(self::assetUrl('js/'. $file), $isAsync, $isDefer);
15
+		return epesi()->requireJS(self::assetUrl('js/' . $file), $isAsync, $isDefer);
16 16
 	}
17 17
 	
18 18
 	final public static function requireCSS($file = 'default.css') {
19
-		return epesi()->requireCSS(self::assetUrl('css/'. $file));
19
+		return epesi()->requireCSS(self::assetUrl('css/' . $file));
20 20
 	}
21 21
 	
22 22
 	/**
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasModule.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	final public static function view($alias = null)
16 16
 	{
17
-		$class = self::namespace() . '\\' . ($alias? Str::studly($alias): self::name()) . 'View';
17
+		$class = self::namespace() . '\\' . ($alias ? Str::studly($alias) : self::name()) . 'View';
18 18
 		
19 19
 		if ($alias) return $class;
20 20
 		
21
-		return static::$view?: $class;
21
+		return static::$view ?: $class;
22 22
 	}
23 23
 	
24 24
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	{
65 65
 		$names = array_slice(explode('\\', static::class), -2, -1);
66 66
 		
67
-		return $names? reset($names): '';
67
+		return $names ? reset($names) : '';
68 68
 	}
69 69
 	
70 70
 	/**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
 	{
17 17
 		$class = self::namespace() . '\\' . ($alias? Str::studly($alias): self::name()) . 'View';
18 18
 		
19
-		if ($alias) return $class;
19
+		if ($alias) {
20
+			return $class;
21
+		}
20 22
 		
21 23
 		return static::$view?: $class;
22 24
 	}
Please login to merge, or discard this patch.
src/System/Integration/Modules/Concerns/HasLaunchButton.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 	{
34 34
 		$link = $this->link();
35 35
 		
36
-		$link = is_array($link)? ModuleView::moduleLink(...$link): $link;
36
+		$link = is_array($link) ? ModuleView::moduleLink(...$link) : $link;
37 37
 		
38 38
 		return (new LaunchButton([
39 39
 				'label' => $this->label(),
Please login to merge, or discard this patch.