Passed
Pull Request — master (#10)
by Anton
04:10
created
www/engine/Framework/Classes/Range/Range.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
 
11 11
 		protected static function init(string $file_name) {
12 12
 
13
-			if (is_array($range = Explorer::php($file_name))) static::$range = $range;
13
+			if (is_array($range = Explorer::php($file_name))) {
14
+				static::$range = $range;
15
+			}
14 16
 		}
15 17
 
16 18
 		# Check if item exists
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Arr/Arr.php 1 patch
Braces   +20 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,12 @@  discard block
 block discarded – undo
10 10
 
11 11
 			$value = false;
12 12
 
13
-			foreach ($path as $item) if (isset($array[$item])) $value = ($array = $array[$item]); else return false;
13
+			foreach ($path as $item) {
14
+				if (isset($array[$item])) $value = ($array = $array[$item]);
15
+			}
16
+			else {
17
+				return false;
18
+			}
14 19
 
15 20
 			# ------------------------
16 21
 
@@ -23,10 +28,12 @@  discard block
 block discarded – undo
23 28
 
24 29
 			$result = [];
25 30
 
26
-			foreach ($keys as $key) if (is_scalar($key)) {
31
+			foreach ($keys as $key) {
32
+				if (is_scalar($key)) {
27 33
 
28 34
 				$result[$key] = ((isset($array[$key]) && is_scalar($array[$key])) ? $array[$key] : false);
29 35
 			}
36
+			}
30 37
 
31 38
 			# ------------------------
32 39
 
@@ -39,7 +46,9 @@  discard block
 block discarded – undo
39 46
 
40 47
 			$result = [];
41 48
 
42
-			foreach ($array as $key => $value) $result[] = [$key_name => $key, $value_name => $value];
49
+			foreach ($array as $key => $value) {
50
+				$result[] = [$key_name => $key, $value_name => $value];
51
+			}
43 52
 
44 53
 			# ------------------------
45 54
 
@@ -57,9 +66,15 @@  discard block
 block discarded – undo
57 66
 
58 67
 			$result = []; $column = array_map($select_key, $array);
59 68
 
60
-			if (!$descending) asort($column); else arsort($column);
69
+			if (!$descending) {
70
+				asort($column);
71
+			} else {
72
+				arsort($column);
73
+			}
61 74
 
62
-			foreach (array_keys($column) as $key) $result[$key] = $array[$key];
75
+			foreach (array_keys($column) as $key) {
76
+				$result[$key] = $array[$key];
77
+			}
63 78
 
64 79
 			# ------------------------
65 80
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Ajax/Utils/Response.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
 
11 11
 		public function set(string $name, $value) {
12 12
 
13
-			if (is_scalar($value)) $this->data[$name] = $value;
13
+			if (is_scalar($value)) {
14
+				$this->data[$name] = $value;
15
+			}
14 16
 
15 17
 			return $this;
16 18
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Menu.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 
21 21
 				$item->children = ($children = Template::group());
22 22
 
23
-				foreach ($this->menu[$id]['children'] as $child) $children->add($this->parseItem($child));
23
+				foreach ($this->menu[$id]['children'] as $child) {
24
+					$children->add($this->parseItem($child));
25
+				}
24 26
 
25 27
 			} else {
26 28
 
@@ -44,7 +46,9 @@  discard block
 block discarded – undo
44 46
 
45 47
 			$menu = Entitizer::treeview(TABLE_MENU)->subtree(0, ['active' => true]);
46 48
 
47
-			if (false !== $menu) $this->menu = $menu;
49
+			if (false !== $menu) {
50
+				$this->menu = $menu;
51
+			}
48 52
 		}
49 53
 
50 54
 		# Get block
@@ -53,7 +57,9 @@  discard block
 block discarded – undo
53 57
 
54 58
 			$menu = Template::group();
55 59
 
56
-			foreach ($this->menu[0]['children'] as $id) $menu->add($this->parseItem($id));
60
+			foreach ($this->menu[0]['children'] as $id) {
61
+				$menu->add($this->parseItem($id));
62
+			}
57 63
 
58 64
 			# ------------------------
59 65
 
Please login to merge, or discard this patch.
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::block($item['text']);
47 49
 
48
-				if (isset($item['title'])) $block->block('title')->set('text', $item['title'])->enable();
50
+				if (isset($item['title'])) {
51
+					$block->block('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/Template/Variables.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,15 @@
 block discarded – undo
14 14
 
15 15
 			$selection = ['name', 'value']; $order = ['name' => 'ASC'];
16 16
 
17
-			if (!(DB::select(TABLE_VARIABLES, $selection, null, $order) && DB::last()->status)) return;
17
+			if (!(DB::select(TABLE_VARIABLES, $selection, null, $order) && DB::last()->status)) {
18
+				return;
19
+			}
18 20
 
19 21
 			# Process results
20 22
 
21
-			while (null !== ($variable = DB::last()->row())) yield $variable['name'] => $variable['value'];
23
+			while (null !== ($variable = DB::last()->row())) {
24
+				yield $variable['name'] => $variable['value'];
25
+			}
22 26
 		}
23 27
 	}
24 28
 }
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Template/Widgets.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,15 @@
 block discarded – undo
14 14
 
15 15
 			$selection = ['name', 'contents']; $condition = ['active' => 1]; $order = ['name' => 'ASC'];
16 16
 
17
-			if (!(DB::select(TABLE_WIDGETS, $selection, $condition, $order) && DB::last()->status)) return;
17
+			if (!(DB::select(TABLE_WIDGETS, $selection, $condition, $order) && DB::last()->status)) {
18
+				return;
19
+			}
18 20
 
19 21
 			# Process results
20 22
 
21
-			while (null !== ($widget = DB::last()->row())) yield $widget['name'] => Template::block($widget['contents']);
23
+			while (null !== ($widget = DB::last()->row())) {
24
+				yield $widget['name'] => Template::block($widget['contents']);
25
+			}
22 26
 		}
23 27
 	}
24 28
 }
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Pagination.php 1 patch
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 
15 15
 			for ($index = ($active - 2); $index <= ($active + 2); $index++) {
16 16
 
17
-				if (!($index > 0 && $index <= $count)) continue;
17
+				if (!($index > 0 && $index <= $count)) {
18
+					continue;
19
+				}
18 20
 
19 21
 				$class = (($index === $active) ? 'active item' : 'item');
20 22
 
@@ -41,7 +43,9 @@  discard block
 block discarded – undo
41 43
 
42 44
 				$block->link = $url->set('index', $index)->string(); $block->index = $index;
43 45
 
44
-				if ($closest) $block->block('ellipsis')->disable();
46
+				if ($closest) {
47
+					$block->block('ellipsis')->disable();
48
+				}
45 49
 			}
46 50
 		}
47 51
 
@@ -58,9 +62,9 @@  discard block
 block discarded – undo
58 62
 
59 63
 				list ($extremum, $index) = $data; $block = $pagination->block($class);
60 64
 
61
-				if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); }
62
-
63
-				else $block->link = $url->set('index', $index)->string();
65
+				if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); } else {
66
+					$block->link = $url->set('index', $index)->string();
67
+				}
64 68
 			}
65 69
 		}
66 70
 
@@ -68,9 +72,13 @@  discard block
 block discarded – undo
68 72
 
69 73
 		public static function block(int $index, int $display, int $total, Url $url) {
70 74
 
71
-			if (($index <= 0) || ($display <= 0) || ($total <= 0)) return false;
75
+			if (($index <= 0) || ($display <= 0) || ($total <= 0)) {
76
+				return false;
77
+			}
72 78
 
73
-			if (($display >= $total) || ($index > ($count = ceil($total / $display)))) return false;
79
+			if (($display >= $total) || ($index > ($count = ceil($total / $display)))) {
80
+				return false;
81
+			}
74 82
 
75 83
 			# Create block
76 84
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Form.php 1 patch
Braces   +14 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,11 @@  discard block
 block discarded – undo
12 12
 
13 13
 			$text = Language::get($code);
14 14
 
15
-			if (!$popup) Messages::set('error', $text); else Popup::set('negative', $text);
15
+			if (!$popup) {
16
+				Messages::set('error', $text);
17
+			} else {
18
+				Popup::set('negative', $text);
19
+			}
16 20
 
17 21
 			# ------------------------
18 22
 
@@ -23,15 +27,21 @@  discard block
 block discarded – undo
23 27
 
24 28
 		public function handle(callable $callback, bool $popup = false) {
25 29
 
26
-			if (false === ($post = $this->post())) return false;
30
+			if (false === ($post = $this->post())) {
31
+				return false;
32
+			}
27 33
 
28 34
 			# Check form for errors
29 35
 
30
-			if ($this->errors()) return $this->displayError('FORM_ERROR_REQUIRED', $popup);
36
+			if ($this->errors()) {
37
+				return $this->displayError('FORM_ERROR_REQUIRED', $popup);
38
+			}
31 39
 
32 40
 			# Call controller method
33 41
 
34
-			if (is_string($result = $callback($post))) return $this->displayError($result, $popup);
42
+			if (is_string($result = $callback($post))) {
43
+				return $this->displayError($result, $popup);
44
+			}
35 45
 
36 46
 			if (is_array($result)) { $this->get($result[0])->error(true); return $this->displayError($result[1], $popup); }
37 47
 
Please login to merge, or discard this patch.