Passed
Pull Request — master (#12)
by Anton
05:30 queued 02:25
created
www/engine/System/Classes/Modules/Install/Install.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 
15 15
 			$extensions = ['mysqli', 'mbstring', 'gd', 'simplexml'];
16 16
 
17
-			foreach ($extensions as $name) self::$requirements[$name] = extension_loaded($name);
17
+			foreach ($extensions as $name) {
18
+				self::$requirements[$name] = extension_loaded($name);
19
+			}
18 20
 
19 21
 			# Check mod_rewrite
20 22
 
@@ -24,7 +26,9 @@  discard block
 block discarded – undo
24 26
 
25 27
 			$writables = ['data' => DIR_SYSTEM_DATA, 'uploads' => DIR_UPLOADS];
26 28
 
27
-			foreach ($writables as $name => $dir) self::$requirements[$name] = is_writable($dir);
29
+			foreach ($writables as $name => $dir) {
30
+				self::$requirements[$name] = is_writable($dir);
31
+			}
28 32
 
29 33
 			# Set checking status
30 34
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Utils/Container.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 
17 17
 			$path = implode('/', $scheme); $path_full = (DIR_UPLOADS . (('' !== $path) ? ($path . '/') : ''));
18 18
 
19
-			if (!Explorer::isDir($path_full)) return;
19
+			if (!Explorer::isDir($path_full)) {
20
+				return;
21
+			}
20 22
 
21 23
 			$this->scheme = $scheme; $this->path = $path; $this->path_full = $path_full;
22 24
 		}
@@ -27,9 +29,12 @@  discard block
 block discarded – undo
27 29
 
28 30
 			$scheme = []; $breadcrumbs = [];
29 31
 
30
-			if ([] !== $this->scheme) foreach ($this->scheme as $name) {
32
+			if ([] !== $this->scheme) {
33
+				foreach ($this->scheme as $name) {
31 34
 
32
-				$scheme[] = $name; $breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name];
35
+				$scheme[] = $name;
36
+			}
37
+			$breadcrumbs[] = ['path' => implode('/', $scheme), 'name' => $name];
33 38
 			}
34 39
 
35 40
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Utils/Entity.php 1 patch
Braces   +36 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 		private function getPrototype(string $name) {
14 14
 
15
-			if (preg_match('/[\/\\\\]/', $name)) return false;
15
+			if (preg_match('/[\/\\\\]/', $name)) {
16
+				return false;
17
+			}
16 18
 
17 19
 			$path = (($this->parent->path() ? ($this->parent->path() . '/') : '') . $name);
18 20
 
@@ -34,11 +36,17 @@  discard block
 block discarded – undo
34 36
 
35 37
 		public function init(string $name) {
36 38
 
37
-			if (false === ($prototype = $this->getPrototype($name))) return false;
39
+			if (false === ($prototype = $this->getPrototype($name))) {
40
+				return false;
41
+			}
38 42
 
39
-			if (!Explorer::{static::$checker}($prototype['path_full'])) return false;
43
+			if (!Explorer::{static::$checker}($prototype['path_full'])) {
44
+				return false;
45
+			}
40 46
 
41
-			foreach ($prototype as $var => $value) $this->$var = $value;
47
+			foreach ($prototype as $var => $value) {
48
+				$this->$var = $value;
49
+			}
42 50
 
43 51
 			# ------------------------
44 52
 
@@ -49,11 +57,17 @@  discard block
 block discarded – undo
49 57
 
50 58
 		public function create(string $name) {
51 59
 
52
-			if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false;
60
+			if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) {
61
+				return false;
62
+			}
53 63
 
54
-			if (!Explorer::{static::$creator}($prototype['path_full'])) return false;
64
+			if (!Explorer::{static::$creator}($prototype['path_full'])) {
65
+				return false;
66
+			}
55 67
 
56
-			foreach ($prototype as $var => $value) $this->$var = $value;
68
+			foreach ($prototype as $var => $value) {
69
+				$this->$var = $value;
70
+			}
57 71
 
58 72
 			# ------------------------
59 73
 
@@ -64,11 +78,17 @@  discard block
 block discarded – undo
64 78
 
65 79
 		public function rename(string $name) {
66 80
 
67
-			if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false;
81
+			if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) {
82
+				return false;
83
+			}
68 84
 
69
-			if (!@rename($this->path_full, $prototype['path_full'])) return false;
85
+			if (!@rename($this->path_full, $prototype['path_full'])) {
86
+				return false;
87
+			}
70 88
 
71
-			foreach ($prototype as $var => $value) $this->$var = $value;
89
+			foreach ($prototype as $var => $value) {
90
+				$this->$var = $value;
91
+			}
72 92
 
73 93
 			# ------------------------
74 94
 
@@ -79,9 +99,13 @@  discard block
 block discarded – undo
79 99
 
80 100
 		public function remove() {
81 101
 
82
-			if ('' === $this->name) return false;
102
+			if ('' === $this->name) {
103
+				return false;
104
+			}
83 105
 
84
-			if (!Explorer::{static::$remover}($this->path_full, true)) return false;
106
+			if (!Explorer::{static::$remover}($this->path_full, true)) {
107
+				return false;
108
+			}
85 109
 
86 110
 			$this->name = ''; $this->path = ''; $this->path_full = '';
87 111
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Utils/Mime.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,19 +12,33 @@
 block discarded – undo
12 12
 
13 13
 			$extension = strtolower(Explorer::extension($file_name, false));
14 14
 
15
-			if (self::isImage($extension)) return 'image';
15
+			if (self::isImage($extension)) {
16
+				return 'image';
17
+			}
16 18
 
17
-			if (self::isAudio($extension)) return 'audio';
19
+			if (self::isAudio($extension)) {
20
+				return 'audio';
21
+			}
18 22
 
19
-			if (self::isVideo($extension)) return 'video';
23
+			if (self::isVideo($extension)) {
24
+				return 'video';
25
+			}
20 26
 
21
-			if (in_array($extension, ['doc', 'docx'], true)) return 'word';
27
+			if (in_array($extension, ['doc', 'docx'], true)) {
28
+				return 'word';
29
+			}
22 30
 
23
-			if (in_array($extension, ['xls', 'xlsx'], true)) return 'excel';
31
+			if (in_array($extension, ['xls', 'xlsx'], true)) {
32
+				return 'excel';
33
+			}
24 34
 
25
-			if (in_array($extension, ['ppt', 'pptx'], true)) return 'powerpoint';
35
+			if (in_array($extension, ['ppt', 'pptx'], true)) {
36
+				return 'powerpoint';
37
+			}
26 38
 
27
-			if ($extension === 'pdf') return 'pdf';
39
+			if ($extension === 'pdf') {
40
+				return 'pdf';
41
+			}
28 42
 
29 43
 			# ------------------------
30 44
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Controller/Menuitem.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
 
40 40
 			$modifier = ((0 === $this->menuitem->id) ? 'create' : 'edit');
41 41
 
42
-			if (!$this->menuitem->$modifier($data)) return 'MENUITEM_ERROR_MODIFY';
42
+			if (!$this->menuitem->$modifier($data)) {
43
+				return 'MENUITEM_ERROR_MODIFY';
44
+			}
43 45
 
44 46
 			# ------------------------
45 47
 
Please login to merge, or discard this patch.
www/engine/Framework/Main.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 
24 24
 # Set defaults
25 25
 
26
-if (function_exists('mb_internal_encoding')) mb_internal_encoding('UTF-8');
26
+if (function_exists('mb_internal_encoding')) {
27
+	mb_internal_encoding('UTF-8');
28
+}
27 29
 
28 30
 date_default_timezone_set('UTC');
29 31
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Str/Str.php 1 patch
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,14 +10,18 @@  discard block
 block discarded – undo
10 10
 
11 11
 			foreach (($string = explode("\n", $string)) as $key => $line) {
12 12
 
13
-				if ($multiline && $codestyle) $string[$key] = rtrim(preg_replace('/[\r\0\x0B]+/', '', $line));
14
-
15
-				else $string[$key] = trim(preg_replace(['/[ \t]+/', '/[\r\0\x0B]+/'], [' ', ''], $line));
13
+				if ($multiline && $codestyle) {
14
+					$string[$key] = rtrim(preg_replace('/[\r\0\x0B]+/', '', $line));
15
+				} else {
16
+					$string[$key] = trim(preg_replace(['/[ \t]+/', '/[\r\0\x0B]+/'], [' ', ''], $line));
17
+				}
16 18
 			}
17 19
 
18
-			if (!$multiline) $string = preg_replace('/ {2,}/', ' ', trim(implode(' ', $string), ' '));
19
-
20
-			else $string = preg_replace('/(\r\n){3,}/', "\r\n\r\n", trim(implode("\r\n", $string), "\r\n"));
20
+			if (!$multiline) {
21
+				$string = preg_replace('/ {2,}/', ' ', trim(implode(' ', $string), ' '));
22
+			} else {
23
+				$string = preg_replace('/(\r\n){3,}/', "\r\n\r\n", trim(implode("\r\n", $string), "\r\n"));
24
+			}
21 25
 
22 26
 			# ------------------------
23 27
 
@@ -136,7 +140,9 @@  discard block
 block discarded – undo
136 140
 
137 141
 		public static function cut(string $string, int $maxlength, bool $ellipsis = false) {
138 142
 
139
-			if (($maxlength < 1) || (self::length($string = trim($string)) <= $maxlength)) return $string;
143
+			if (($maxlength < 1) || (self::length($string = trim($string)) <= $maxlength)) {
144
+				return $string;
145
+			}
140 146
 
141 147
 			$string = (rtrim(self::substr($string, 0, $maxlength)) . ($ellipsis ? '...' : ''));
142 148
 
@@ -149,9 +155,13 @@  discard block
 block discarded – undo
149 155
 
150 156
 		public static function random(int $length, string $pool = STR_POOL_DEFAULT) {
151 157
 
152
-			if (($length < 1) || (0 === ($pool_length = self::length($pool)))) return '';
158
+			if (($length < 1) || (0 === ($pool_length = self::length($pool)))) {
159
+				return '';
160
+			}
153 161
 
154
-			$string = ''; for ($i = 0; $i < $length; $i++) $string .= self::substr($pool, random_int(0, ($pool_length - 1)), 1);
162
+			$string = ''; for ($i = 0; $i < $length; $i++) {
163
+				$string .= self::substr($pool, random_int(0, ($pool_length - 1)), 1);
164
+			}
155 165
 
156 166
 			# ------------------------
157 167
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Cookie/Cookie.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@
 block discarded – undo
31 31
 
32 32
 		public static function delete(string $name) {
33 33
 
34
-			if (isset($_COOKIE[$name])) unset($_COOKIE[$name]);
34
+			if (isset($_COOKIE[$name])) {
35
+				unset($_COOKIE[$name]);
36
+			}
35 37
 		}
36 38
 	}
37 39
 }
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Mime/Mime.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
 		private static function checkType(string $extension, string $type) {
12 12
 
13
-			if (false === ($mime = self::get($extension))) return false;
13
+			if (false === ($mime = self::get($extension))) {
14
+				return false;
15
+			}
14 16
 
15 17
 			return (preg_match('/^' . $type . '\//', $mime) ? true : false);
16 18
 		}
Please login to merge, or discard this patch.