Passed
Pull Request — master (#12)
by Anton
05:30 queued 02:25
created
www/engine/System/Classes/Modules/Settings/Controller/General.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 			# Check for demo mode
14 14
 
15
-			if (MODE_DEMO) return 'DEMO_MODE_RESTRICTION';
15
+			if (MODE_DEMO) {
16
+				return 'DEMO_MODE_RESTRICTION';
17
+			}
16 18
 
17 19
 			# Define errors list
18 20
 
@@ -25,12 +27,16 @@  discard block
 block discarded – undo
25 27
 
26 28
 			foreach (Settings::setArray($post) as $name => $result) {
27 29
 
28
-				if (!$result) return (isset($errors[$name]) ? [$name, $errors[$name]] : false);
30
+				if (!$result) {
31
+					return (isset($errors[$name]) ? [$name, $errors[$name]] : false);
32
+				}
29 33
 			}
30 34
 
31 35
 			# Save settings
32 36
 
33
-			if (!Settings::save()) return 'SETTINGS_ERROR_SAVE';
37
+			if (!Settings::save()) {
38
+				return 'SETTINGS_ERROR_SAVE';
39
+			}
34 40
 
35 41
 			# ------------------------
36 42
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Extend/Utils/Handler/Basic.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,13 +30,19 @@  discard block
 block discarded – undo
30 30
 
31 31
 			if (Request::post('action') === 'activate') {
32 32
 
33
-				if (MODE_DEMO) return $ajax->setError(Language::get('DEMO_MODE_RESTRICTION'));
33
+				if (MODE_DEMO) {
34
+					return $ajax->setError(Language::get('DEMO_MODE_RESTRICTION'));
35
+				}
34 36
 
35 37
 				$param = static::$param[$this->loader->section()]; $name = Request::post('name');
36 38
 
37
-				if (false === Settings::set($param, $name)) return $ajax->setError(Language::get(static::$error_activate));
39
+				if (false === Settings::set($param, $name)) {
40
+					return $ajax->setError(Language::get(static::$error_activate));
41
+				}
38 42
 
39
-				if (false === Settings::save()) return $ajax->setError(Language::get(static::$error_save));
43
+				if (false === Settings::save()) {
44
+					return $ajax->setError(Language::get(static::$error_save));
45
+				}
40 46
 
41 47
 			} else if (Request::post('action') === 'list') {
42 48
 
@@ -54,7 +60,9 @@  discard block
 block discarded – undo
54 60
 
55 61
 			$this->loader = new static::$loader_class(Request::get('list'));
56 62
 
57
-			if (Request::isAjax()) return $this->handleAjax();
63
+			if (Request::isAjax()) {
64
+				return $this->handleAjax();
65
+			}
58 66
 
59 67
 			# ------------------------
60 68
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Controller/Variable.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,19 @@  discard block
 block discarded – undo
29 29
 
30 30
 			# Validate name
31 31
 
32
-			if (false === ($name = Validate::templateComponentName($name))) return ['name', 'VARIABLE_ERROR_NAME_INVALID'];
32
+			if (false === ($name = Validate::templateComponentName($name))) {
33
+				return ['name', 'VARIABLE_ERROR_NAME_INVALID'];
34
+			}
33 35
 
34 36
 			# Check name exists
35 37
 
36
-			if (false === ($check_name = $this->variable->check($name, 'name'))) return 'VARIABLE_ERROR_MODIFY';
38
+			if (false === ($check_name = $this->variable->check($name, 'name'))) {
39
+				return 'VARIABLE_ERROR_MODIFY';
40
+			}
37 41
 
38
-			if ($check_name === 1) return ['name', 'VARIABLE_ERROR_NAME_DUPLICATE'];
42
+			if ($check_name === 1) {
43
+				return ['name', 'VARIABLE_ERROR_NAME_DUPLICATE'];
44
+			}
39 45
 
40 46
 			# Modify variable
41 47
 
@@ -47,7 +53,9 @@  discard block
 block discarded – undo
47 53
 
48 54
 			$modifier = ((0 === $this->variable->id) ? 'create' : 'edit');
49 55
 
50
-			if (!$this->variable->$modifier($data)) return 'VARIABLE_ERROR_MODIFY';
56
+			if (!$this->variable->$modifier($data)) {
57
+				return 'VARIABLE_ERROR_MODIFY';
58
+			}
51 59
 
52 60
 			# ------------------------
53 61
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Controller/Widget.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,19 @@  discard block
 block discarded – undo
29 29
 
30 30
 			# Validate name
31 31
 
32
-			if (false === ($name = Validate::templateComponentName($name))) return ['name', 'WIDGET_ERROR_NAME_INVALID'];
32
+			if (false === ($name = Validate::templateComponentName($name))) {
33
+				return ['name', 'WIDGET_ERROR_NAME_INVALID'];
34
+			}
33 35
 
34 36
 			# Check name exists
35 37
 
36
-			if (false === ($check_name = $this->widget->check($name, 'name'))) return 'WIDGET_ERROR_MODIFY';
38
+			if (false === ($check_name = $this->widget->check($name, 'name'))) {
39
+				return 'WIDGET_ERROR_MODIFY';
40
+			}
37 41
 
38
-			if ($check_name === 1) return ['name', 'WIDGET_ERROR_NAME_DUPLICATE'];
42
+			if ($check_name === 1) {
43
+				return ['name', 'WIDGET_ERROR_NAME_DUPLICATE'];
44
+			}
39 45
 
40 46
 			# Modify widget
41 47
 
@@ -48,7 +54,9 @@  discard block
 block discarded – undo
48 54
 
49 55
 			$modifier = ((0 === $this->widget->id) ? 'create' : 'edit');
50 56
 
51
-			if (!$this->widget->$modifier($data)) return 'WIDGET_ERROR_MODIFY';
57
+			if (!$this->widget->$modifier($data)) {
58
+				return 'WIDGET_ERROR_MODIFY';
59
+			}
52 60
 
53 61
 			# ------------------------
54 62
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Utils/Map.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
 			if (false === ($handler = self::parseString($route['handler'], REGEX_MAP_ITEM_HANDLER))) return;
69 69
 
70
-			self::$routes['/' . implode('/', $path)] = ('Addons\\' . $name . '\\' . implode('\\', $handler));
70
+			self::$routes['/'.implode('/', $path)] = ('Addons\\'.$name.'\\'.implode('\\', $handler));
71 71
 		}
72 72
 
73 73
 		# Parse item
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 			$parts = preg_split('/\//', $string, 0, PREG_SPLIT_NO_EMPTY);
54 54
 
55
-			foreach ($parts as $name) if (!preg_match($regex, $name)) return false;
55
+			foreach ($parts as $name) {
56
+				if (!preg_match($regex, $name)) return false;
57
+			}
56 58
 
57 59
 			# ------------------------
58 60
 
@@ -63,9 +65,13 @@  discard block
 block discarded – undo
63 65
 
64 66
 		private static function parseRoute(string $name, array $route) {
65 67
 
66
-			if (false === ($path = self::parseString($route['path'], REGEX_MAP_ITEM_PATH))) return;
68
+			if (false === ($path = self::parseString($route['path'], REGEX_MAP_ITEM_PATH))) {
69
+				return;
70
+			}
67 71
 
68
-			if (false === ($handler = self::parseString($route['handler'], REGEX_MAP_ITEM_HANDLER))) return;
72
+			if (false === ($handler = self::parseString($route['handler'], REGEX_MAP_ITEM_HANDLER))) {
73
+				return;
74
+			}
69 75
 
70 76
 			self::$routes['/' . implode('/', $path)] = ('Addons\\' . $name . '\\' . implode('\\', $handler));
71 77
 		}
@@ -74,14 +80,18 @@  discard block
 block discarded – undo
74 80
 
75 81
 		private static function parseItem(array $item) {
76 82
 
77
-			foreach ($item['routes'] as $route) self::parseRoute($item['name'], $route);
83
+			foreach ($item['routes'] as $route) {
84
+				self::parseRoute($item['name'], $route);
85
+			}
78 86
 		}
79 87
 
80 88
 		# Autoloader
81 89
 
82 90
 		public static function __autoload() {
83 91
 
84
-			foreach (Extend\Addons::items() as $item) self::parseItem($item);
92
+			foreach (Extend\Addons::items() as $item) {
93
+				self::parseItem($item);
94
+			}
85 95
 		}
86 96
 
87 97
 		# Get handler by url
Please login to merge, or discard this patch.