Passed
Push — master ( c7e98d...e0d6a2 )
by Anton
04:56 queued 01:50
created
www/engine/System/Classes/Utils/Messages.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 		public static function set(string $type, string $text, string $title = null) {
23 23
 
24
-			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) return;
24
+			if (!in_array($type, static::$types, true) || isset(static::$items[$type]) || ('' === $text)) {
25
+				return;
26
+			}
25 27
 
26 28
 			static::$items[$type] = ['text' => $text, 'title' => (('' !== $title) ? $title : null)];
27 29
 		}
@@ -45,7 +47,9 @@  discard block
 block discarded – undo
45 47
 
46 48
 				$block->type = $type; $block->text = Template::createBlock($item['text']);
47 49
 
48
-				if (isset($item['title'])) $block->getBlock('title')->set('text', $item['title'])->enable();
50
+				if (isset($item['title'])) {
51
+					$block->getBlock('title')->set('text', $item['title'])->enable();
52
+				}
49 53
 			}
50 54
 
51 55
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Schema/_Array.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,13 +8,17 @@
 block discarded – undo
8 8
 
9 9
 		public function validate($data) {
10 10
 
11
-			if (!is_array($data)) return null;
11
+			if (!is_array($data)) {
12
+				return null;
13
+			}
12 14
 
13 15
 			$result = [];
14 16
 
15 17
 			foreach ($data as $item) {
16 18
 
17
-				if (!is_array($item) || (null === ($item = parent::validate($item)))) return null;
19
+				if (!is_array($item) || (null === ($item = parent::validate($item)))) {
20
+					return null;
21
+				}
18 22
 
19 23
 				$result[] = $item;
20 24
 			}
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/SEO.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 		public static function title(string $value = null) {
19 19
 
20
-			if (null === $value) return (self::$data['title'] ?? '');
20
+			if (null === $value) {
21
+				return (self::$data['title'] ?? '');
22
+			}
21 23
 
22 24
 			self::$data['title'] = $value;
23 25
 		}
@@ -26,7 +28,9 @@  discard block
 block discarded – undo
26 28
 
27 29
 		public static function description(string $value = null) {
28 30
 
29
-			if (null === $value) return (self::$data['description'] ?? '');
31
+			if (null === $value) {
32
+				return (self::$data['description'] ?? '');
33
+			}
30 34
 
31 35
 			self::$data['description'] = $value;
32 36
 		}
@@ -35,7 +39,9 @@  discard block
 block discarded – undo
35 39
 
36 40
 		public static function keywords(string $value = null) {
37 41
 
38
-			if (null === $value) return (self::$data['keywords'] ?? '');
42
+			if (null === $value) {
43
+				return (self::$data['keywords'] ?? '');
44
+			}
39 45
 
40 46
 			self::$data['keywords'] = $value;
41 47
 		}
@@ -44,7 +50,9 @@  discard block
 block discarded – undo
44 50
 
45 51
 		public static function robotsIndex(bool $value = null) {
46 52
 
47
-			if (null === $value) return (self::$data['robots_index'] ?? false);
53
+			if (null === $value) {
54
+				return (self::$data['robots_index'] ?? false);
55
+			}
48 56
 
49 57
 			self::$data['robots_index'] = $value;
50 58
 		}
@@ -53,7 +61,9 @@  discard block
 block discarded – undo
53 61
 
54 62
 		public static function robotsFollow(bool $value = null) {
55 63
 
56
-			if (null === $value) return (self::$data['robots_follow'] ?? false);
64
+			if (null === $value) {
65
+				return (self::$data['robots_follow'] ?? false);
66
+			}
57 67
 
58 68
 			self::$data['robots_follow'] = $value;
59 69
 		}
@@ -62,7 +72,9 @@  discard block
 block discarded – undo
62 72
 
63 73
 		public static function canonical(string $value = null) {
64 74
 
65
-			if (null === $value) return (self::$data['canonical'] ?? '');
75
+			if (null === $value) {
76
+				return (self::$data['canonical'] ?? '');
77
+			}
66 78
 
67 79
 			self::$data['canonical'] = $value;
68 80
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Common/Addons.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 		protected static $loader_class = 'Modules\Extend\Loader\Addons';
12 12
 
13
-		protected static $root_dir = (DIR_SYSTEM_CLASSES . 'Addons/');
13
+		protected static $root_dir = (DIR_SYSTEM_CLASSES.'Addons/');
14 14
 
15 15
 		protected static $schema_prototype = 'Prototype\Addon', $schema = 'Addons', $regex_name = REGEX_ADDON_NAME;
16 16
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Common/Templates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 		protected static $loader_class = 'Modules\Extend\Loader\Templates', $exception_class = 'Exception\Template';
12 12
 
13
-		protected static $root_dir = [SECTION_ADMIN => DIR_SYSTEM_TEMPLATES . 'Admin/', SECTION_SITE => DIR_SYSTEM_TEMPLATES . 'Site/'];
13
+		protected static $root_dir = [SECTION_ADMIN => DIR_SYSTEM_TEMPLATES.'Admin/', SECTION_SITE => DIR_SYSTEM_TEMPLATES.'Site/'];
14 14
 
15 15
 		protected static $schema_prototype = 'Prototype\Template', $regex_name = REGEX_TEMPLATE_NAME;
16 16
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Handler/Addons.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,13 +35,17 @@  discard block
 block discarded – undo
35 35
 
36 36
 				$name = Request::post('name');
37 37
 
38
-				if (!$this->loader->install($name, true)) return $ajax->setError(Language::get(static::$error_install));
38
+				if (!$this->loader->install($name, true)) {
39
+					return $ajax->setError(Language::get(static::$error_install));
40
+				}
39 41
 
40 42
 			} else if (Request::post('action') === 'uninstall') {
41 43
 
42 44
 				$name = Request::post('name');
43 45
 
44
-				if (!$this->loader->install($name, false)) return $ajax->setError(Language::get(static::$error_uninstall));
46
+				if (!$this->loader->install($name, false)) {
47
+					return $ajax->setError(Language::get(static::$error_uninstall));
48
+				}
45 49
 			}
46 50
 
47 51
 			# ------------------------
@@ -55,7 +59,9 @@  discard block
 block discarded – undo
55 59
 
56 60
 			$this->loader = new static::$loader_class;
57 61
 
58
-			if (Request::isAjax()) return $this->handleAjax();
62
+			if (Request::isAjax()) {
63
+				return $this->handleAjax();
64
+			}
59 65
 
60 66
 			# ------------------------
61 67
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Loader/Basic.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 			if (null === $this->primary) return false;
132 132
 
133
-			return ($this->dir_name . $this->primary['name'] . '/');
133
+			return ($this->dir_name.$this->primary['name'].'/');
134 134
 		}
135 135
 
136 136
 		# Get active extension path
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 			if (null === $this->active) return false;
141 141
 
142
-			return ($this->dir_name . $this->active['name'] . '/');
142
+			return ($this->dir_name.$this->active['name'].'/');
143 143
 		}
144 144
 
145 145
 		# Get active extension data
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,11 +33,15 @@  discard block
 block discarded – undo
33 33
 
34 34
 		protected function getFirst() {
35 35
 
36
-			if ($this->loaded) return ($this->items[key($this->items)] ?? null);
36
+			if ($this->loaded) {
37
+				return ($this->items[key($this->items)] ?? null);
38
+			}
37 39
 
38 40
 			foreach (Explorer::iterateDirs($this->dir_name) as $name) {
39 41
 
40
-				if (null !== ($data = $this->getItem($name))) return $data;
42
+				if (null !== ($data = $this->getItem($name))) {
43
+					return $data;
44
+				}
41 45
 			}
42 46
 
43 47
 			# ------------------------
@@ -53,7 +57,9 @@  discard block
 block discarded – undo
53 57
 
54 58
 			foreach (Explorer::iterateDirs($this->dir_name) as $name) {
55 59
 
56
-				if (null !== ($data = $this->getItem($name))) $items[$name] = $data;
60
+				if (null !== ($data = $this->getItem($name))) {
61
+					$items[$name] = $data;
62
+				}
57 63
 			}
58 64
 
59 65
 			# ------------------------
@@ -94,7 +100,9 @@  discard block
 block discarded – undo
94 100
 
95 101
 		public function activate(string $name) {
96 102
 
97
-			if (null === ($data = $this->getItem($name))) return false;
103
+			if (null === ($data = $this->getItem($name))) {
104
+				return false;
105
+			}
98 106
 
99 107
 			$this->active = $data;
100 108
 
@@ -128,7 +136,9 @@  discard block
 block discarded – undo
128 136
 
129 137
 		public function pathPrimary() {
130 138
 
131
-			if (null === $this->primary) return false;
139
+			if (null === $this->primary) {
140
+				return false;
141
+			}
132 142
 
133 143
 			return ($this->dir_name . $this->primary['name'] . '/');
134 144
 		}
@@ -137,7 +147,9 @@  discard block
 block discarded – undo
137 147
 
138 148
 		public function path() {
139 149
 
140
-			if (null === $this->active) return false;
150
+			if (null === $this->active) {
151
+				return false;
152
+			}
141 153
 
142 154
 			return ($this->dir_name . $this->active['name'] . '/');
143 155
 		}
@@ -146,7 +158,9 @@  discard block
 block discarded – undo
146 158
 
147 159
 		public function data(string $name = null) {
148 160
 
149
-			if (null === $name) return ($this->active ?? false);
161
+			if (null === $name) {
162
+				return ($this->active ?? false);
163
+			}
150 164
 
151 165
 			return ($this->active[$name] ?? false);
152 166
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Loader/Addons.php 1 patch
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 			foreach ((Schema::get(static::$schema)->load() ?? []) as $item) {
24 24
 
25
-				if (isset($items[$item['name']])) $items[$item['name']]['installed'] = true;
25
+				if (isset($items[$item['name']])) {
26
+					$items[$item['name']]['installed'] = true;
27
+				}
26 28
 			}
27 29
 
28 30
 			# ------------------------
@@ -38,7 +40,9 @@  discard block
 block discarded – undo
38 40
 
39 41
 			foreach ((Schema::get(static::$schema)->load() ?? []) as $item) {
40 42
 
41
-				if (static::$extension_class::valid($item['name'])) $items[$item['name']] = $item;
43
+				if (static::$extension_class::valid($item['name'])) {
44
+					$items[$item['name']] = $item;
45
+				}
42 46
 			}
43 47
 
44 48
 			# ------------------------
@@ -59,18 +63,26 @@  discard block
 block discarded – undo
59 63
 
60 64
 		public function install(string $name, bool $value = true) {
61 65
 
62
-			if (!isset($this->items[$name])) return false;
66
+			if (!isset($this->items[$name])) {
67
+				return false;
68
+			}
63 69
 
64 70
 			$items = [];
65 71
 
66 72
 			foreach ($this->items as $item) {
67 73
 
68
-				if ($value) { if ($item['installed'] || ($item['name'] === $name)) $items[] = $item; }
69
-
70
-				else { if ($item['installed'] && ($item['name'] !== $name)) $items[] = $item; }
74
+				if ($value) { if ($item['installed'] || ($item['name'] === $name)) {
75
+					$items[] = $item;
76
+				}
77
+				} else { if ($item['installed'] && ($item['name'] !== $name)) {
78
+					$items[] = $item;
79
+				}
80
+				}
71 81
 			}
72 82
 
73
-			if (!Schema::get(static::$schema)->save($items)) return false;
83
+			if (!Schema::get(static::$schema)->save($items)) {
84
+				return false;
85
+			}
74 86
 
75 87
 			$this->items[$name]['installed'] = $value;
76 88
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Handler.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@
 block discarded – undo
20 20
 
21 21
 				$contents->getBlock('items')->addItem($item = View::get(static::$view_item));
22 22
 
23
-				foreach ($data as $property => $value) $item->$property = $value;
23
+				foreach ($data as $property => $value) {
24
+					$item->$property = $value;
25
+				}
24 26
 
25 27
 				# Process item
26 28
 
Please login to merge, or discard this patch.