Passed
Pull Request — master (#17)
by Anton
03:14
created
www/engine/System/Classes/Modules/Profile/Handler/Edit.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
 			if ($this->form_personal->handle($controller_personal) || $this->form_password->handle($controller_password)) {
47 47
 
48
-				Request::redirect(INSTALL_PATH . '/profile/edit?submitted');
48
+				Request::redirect(INSTALL_PATH.'/profile/edit?submitted');
49 49
 			}
50 50
 
51 51
 			# Display success message
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@
 block discarded – undo
50 50
 
51 51
 			# Display success message
52 52
 
53
-			if (false !== Request::get('submitted')) Messages::set('success', Language::get('USER_SUCCESS_EDIT'));
53
+			if (false !== Request::get('submitted')) {
54
+				Messages::set('success', Language::get('USER_SUCCESS_EDIT'));
55
+			}
54 56
 
55 57
 			# ------------------------
56 58
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query/Insert.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
 
25 25
 				if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', ');
26 26
 
27
-				$values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')');
27
+				$values[] = ('('.$this->getString(array_values($row), '$value', ', ').')');
28 28
 			}
29 29
 
30 30
 			# Build query
31 31
 
32
-			$this->query = ('INSERT ' . ($ignore ? 'IGNORE ' : '') .
32
+			$this->query = ('INSERT '.($ignore ? 'IGNORE ' : '').
33 33
 
34
-				'INTO ' . $table . ' (' . $names . ') VALUES ' . implode(', ', $values));
34
+				'INTO '.$table.' ('.$names.') VALUES '.implode(', ', $values));
35 35
 		}
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,9 +29,11 @@
 block discarded – undo
29 29
 
30 30
 			$names = ''; $values = [];
31 31
 
32
-			foreach ($set as $key => $row) if (is_array($row)) {
32
+			foreach ($set as $key => $row) {
33
+				if (is_array($row)) {
33 34
 
34 35
 				if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', ');
36
+			}
35 37
 
36 38
 				$values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')');
37 39
 			}
Please login to merge, or discard this patch.
www/engine/System/Includes/Tables.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 # Database tables
4 4
 
5
-define('TABLE_PAGES',                               'pages');
6
-define('TABLE_PAGES_RELATIONS',                     'pages_relations');
5
+define('TABLE_PAGES', 'pages');
6
+define('TABLE_PAGES_RELATIONS', 'pages_relations');
7 7
 
8
-define('TABLE_MENU',                                'menu');
9
-define('TABLE_MENU_RELATIONS',                      'menu_relations');
8
+define('TABLE_MENU', 'menu');
9
+define('TABLE_MENU_RELATIONS', 'menu_relations');
10 10
 
11
-define('TABLE_VARIABLES',                           'variables');
12
-define('TABLE_WIDGETS',                             'widgets');
11
+define('TABLE_VARIABLES', 'variables');
12
+define('TABLE_WIDGETS', 'widgets');
13 13
 
14
-define('TABLE_USERS',                               'users');
15
-define('TABLE_USERS_SECRETS',                       'users_secrets');
16
-define('TABLE_USERS_SESSIONS',                      'users_sessions');
14
+define('TABLE_USERS', 'users');
15
+define('TABLE_USERS_SECRETS', 'users_secrets');
16
+define('TABLE_USERS_SESSIONS', 'users_sessions');
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Controller/Rename.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
 			if ((0 !== strcasecmp($this->entity->name(), $name)) &&
41 41
 
42
-				@file_exists($this->entity->parent()->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
42
+				@file_exists($this->entity->parent()->pathFull().$name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
43 43
 
44 44
 			# Rename item
45 45
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,19 +29,25 @@
 block discarded – undo
29 29
 
30 30
 			# Validate name
31 31
 
32
-			if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID'];
32
+			if (false === ($name = Validate::fileName($name))) {
33
+				return ['name', 'FILEMANAGER_ERROR_NAME_INVALID'];
34
+			}
33 35
 
34 36
 			# Check if item exists
35 37
 
36 38
 			if ((0 !== strcasecmp($this->entity->name(), $name)) &&
37 39
 
38
-				@file_exists($this->entity->parent()->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
40
+				@file_exists($this->entity->parent()->pathFull() . $name)) {
41
+				return ['name', 'FILEMANAGER_ERROR_EXISTS'];
42
+			}
39 43
 
40 44
 			# Rename item
41 45
 
42
-			if (!$this->entity->rename($name)) return (($this->entity->type() === FILEMANAGER_TYPE_DIR) ?
46
+			if (!$this->entity->rename($name)) {
47
+				return (($this->entity->type() === FILEMANAGER_TYPE_DIR) ?
43 48
 
44 49
 				'FILEMANAGER_ERROR_DIR_RENAME' : 'FILEMANAGER_ERROR_FILE_RENAME');
50
+			}
45 51
 
46 52
 			# ------------------------
47 53
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Controller/Create.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
 			# Check if item exists
39 39
 
40
-			if (@file_exists($this->parent->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
40
+			if (@file_exists($this->parent->pathFull().$name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
41 41
 
42 42
 			# Create item
43 43
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,19 +29,25 @@
 block discarded – undo
29 29
 
30 30
 			# Validate name
31 31
 
32
-			if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID'];
32
+			if (false === ($name = Validate::fileName($name))) {
33
+				return ['name', 'FILEMANAGER_ERROR_NAME_INVALID'];
34
+			}
33 35
 
34 36
 			# Check if item exists
35 37
 
36
-			if (@file_exists($this->parent->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS'];
38
+			if (@file_exists($this->parent->pathFull() . $name)) {
39
+				return ['name', 'FILEMANAGER_ERROR_EXISTS'];
40
+			}
37 41
 
38 42
 			# Create item
39 43
 
40 44
 			$entity = Filemanager::get($type, $this->parent);
41 45
 
42
-			if (!$entity->create($name)) return (($entity->type() === FILEMANAGER_TYPE_DIR) ?
46
+			if (!$entity->create($name)) {
47
+				return (($entity->type() === FILEMANAGER_TYPE_DIR) ?
43 48
 
44 49
 				'FILEMANAGER_ERROR_DIR_CREATE' : 'FILEMANAGER_ERROR_FILE_CREATE');
50
+			}
45 51
 
46 52
 			# ------------------------
47 53
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Definition/Item/Index.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 			return ((null !== $this->type) ? ($this->type . " ") : "") .
34 34
 
35
-			       ("KEY `" . $this->name . "` (`" . $this->name . "`)");
35
+				   ("KEY `" . $this->name . "` (`" . $this->name . "`)");
36 36
 		}
37 37
 	}
38 38
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@
 block discarded – undo
45 45
 
46 46
 		public function getStatement() : string {
47 47
 
48
-			return ((null !== $this->type) ? ($this->type . " ") : "") .
48
+			return ((null !== $this->type) ? ($this->type." ") : "").
49 49
 
50
-			       ("KEY `" . $this->name . "` (`" . $this->name . "`)");
50
+			       ("KEY `".$this->name."` (`".$this->name."`)");
51 51
 		}
52 52
 	}
53 53
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@
 block discarded – undo
36 36
 
37 37
 			$this->name = $name;
38 38
 
39
-			if (null !== $type) $this->type = $this->validateType($type);
39
+			if (null !== $type) {
40
+				$this->type = $this->validateType($type);
41
+			}
40 42
 		}
41 43
 
42 44
 		/**
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Definition.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
 
31 31
 			$query = ("CREATE TABLE IF NOT EXISTS `" . static::$table . "` (") .
32 32
 
33
-			         implode(", ", $this->getStatements()) .
33
+					 implode(", ", $this->getStatements()) .
34 34
 
35
-			         (") ENGINE=InnoDB DEFAULT CHARSET=utf8");
35
+					 (") ENGINE=InnoDB DEFAULT CHARSET=utf8");
36 36
 
37 37
 			# ------------------------
38 38
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
 		private function createMainTable() : bool {
43 43
 
44
-			$query = ("CREATE TABLE IF NOT EXISTS `" . static::$table . "` (") .
44
+			$query = ("CREATE TABLE IF NOT EXISTS `".static::$table."` (").
45 45
 
46
-			         implode(", ", $this->getStatements()) .
46
+			         implode(", ", $this->getStatements()).
47 47
 
48 48
 			         (") ENGINE=InnoDB DEFAULT CHARSET=utf8");
49 49
 
@@ -60,17 +60,17 @@  discard block
 block discarded – undo
60 60
 
61 61
 		private function createRelationsTable() : bool {
62 62
 
63
-			$query = ("CREATE TABLE IF NOT EXISTS `" . static::$table_relations . "` (") .
63
+			$query = ("CREATE TABLE IF NOT EXISTS `".static::$table_relations."` (").
64 64
 
65
-					 ("`ancestor` int(10) UNSIGNED NOT NULL, `descendant` int(10) UNSIGNED NOT NULL, ") .
65
+					 ("`ancestor` int(10) UNSIGNED NOT NULL, `descendant` int(10) UNSIGNED NOT NULL, ").
66 66
 
67
-					 ("`depth` int(10) UNSIGNED NOT NULL, ") .
67
+					 ("`depth` int(10) UNSIGNED NOT NULL, ").
68 68
 
69
-					 ("PRIMARY KEY (`ancestor`, `descendant`), KEY (`ancestor`), KEY (`descendant`), KEY (`depth`), ") .
69
+					 ("PRIMARY KEY (`ancestor`, `descendant`), KEY (`ancestor`), KEY (`descendant`), KEY (`depth`), ").
70 70
 
71
-					 ("FOREIGN KEY (`ancestor`) REFERENCES `" . static::$table . "` (`id`) ON DELETE CASCADE, ") .
71
+					 ("FOREIGN KEY (`ancestor`) REFERENCES `".static::$table."` (`id`) ON DELETE CASCADE, ").
72 72
 
73
-					 ("FOREIGN KEY (`descendant`) REFERENCES `" . static::$table . "` (`id`) ON DELETE CASCADE ") .
73
+					 ("FOREIGN KEY (`descendant`) REFERENCES `".static::$table."` (`id`) ON DELETE CASCADE ").
74 74
 
75 75
 					 (") ENGINE=InnoDB DEFAULT CHARSET=utf8");
76 76
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		private function removeMainTable() : bool {
89 89
 
90
-			$query = ("DROP TABLE IF EXISTS `" . static::$table  . "`");
90
+			$query = ("DROP TABLE IF EXISTS `".static::$table."`");
91 91
 
92 92
 			return (DB::send($query) && DB::getLast()->status);
93 93
 		}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 		private function removeRelationsTable() : bool {
102 102
 
103
-			$query = ("DROP TABLE IF EXISTS `" . static::$table_relations  . "`");
103
+			$query = ("DROP TABLE IF EXISTS `".static::$table_relations."`");
104 104
 
105 105
 			return (DB::send($query) && DB::getLast()->status);
106 106
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
 
26 26
 			foreach ([$this->params, $this->indexes, $this->foreigns] as $group) {
27 27
 
28
-				foreach ($group->getList() as $item) $statements[] = $item->getStatement();
28
+				foreach ($group->getList() as $item) {
29
+					$statements[] = $item->getStatement();
30
+				}
29 31
 			}
30 32
 
31 33
 			# ------------------------
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Utils/Lister.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,9 +65,9 @@
 block discarded – undo
65 65
 
66 66
 		private function getPaginationBlock() {
67 67
 
68
-			$query = (static::$nesting ? ('?parent_id=' . $this->parent->id) : '');
68
+			$query = (static::$nesting ? ('?parent_id='.$this->parent->id) : '');
69 69
 
70
-			$url = new Url(INSTALL_PATH . static::$link . $query);
70
+			$url = new Url(INSTALL_PATH.static::$link.$query);
71 71
 
72 72
 			# ------------------------
73 73
 
Please login to merge, or discard this patch.
Braces   +36 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 
30 30
 			# Set create button
31 31
 
32
-			if (count($this->path) < CONFIG_ENTITIZER_MAX_DEPTH) $parent->getBlock('create')->id = $this->parent->id;
33
-
34
-			else { $parent->getBlock('create')->disable(); $parent->getBlock('create_disabled')->enable(); }
32
+			if (count($this->path) < CONFIG_ENTITIZER_MAX_DEPTH) {
33
+				$parent->getBlock('create')->id = $this->parent->id;
34
+			} else { $parent->getBlock('create')->disable(); $parent->getBlock('create_disabled')->enable(); }
35 35
 
36 36
 			# Set edit button
37 37
 
38
-			if (0 !== $this->parent->id) $parent->getBlock('edit')->id = $this->parent->id;
39
-
40
-			else { $parent->getBlock('edit')->disable(); $parent->getBlock('edit_disabled')->enable(); }
38
+			if (0 !== $this->parent->id) {
39
+				$parent->getBlock('edit')->id = $this->parent->id;
40
+			} else { $parent->getBlock('edit')->disable(); $parent->getBlock('edit_disabled')->enable(); }
41 41
 
42 42
 			# Add parent additional data
43 43
 
@@ -52,7 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 			foreach ($this->items['list'] as $item) {
54 54
 
55
-				if ((null !== $this->entity) && ($item['dataset']->id === $this->entity->id)) continue;
55
+				if ((null !== $this->entity) && ($item['dataset']->id === $this->entity->id)) {
56
+					continue;
57
+				}
56 58
 
57 59
 				$items->addItem($view = View::get(!$ajax ? static::$view_item : static::$view_ajax_item));
58 60
 
@@ -121,11 +123,15 @@  discard block
 block discarded – undo
121 123
 
122 124
 			# Set path
123 125
 
124
-			if (static::$nesting) $contents->path = $this->path;
126
+			if (static::$nesting) {
127
+				$contents->path = $this->path;
128
+			}
125 129
 
126 130
 			# Process parent block
127 131
 
128
-			if (static::$nesting && !$ajax) $this->processParent($contents->getBlock('parent'));
132
+			if (static::$nesting && !$ajax) {
133
+				$this->processParent($contents->getBlock('parent'));
134
+			}
129 135
 
130 136
 			# Process items block
131 137
 
@@ -133,7 +139,9 @@  discard block
 block discarded – undo
133 139
 
134 140
 			# Set pagination
135 141
 
136
-			if (!$ajax) $contents->pagination = $this->getPaginationBlock();
142
+			if (!$ajax) {
143
+				$contents->pagination = $this->getPaginationBlock();
144
+			}
137 145
 
138 146
 			# ------------------------
139 147
 
@@ -160,15 +168,21 @@  discard block
 block discarded – undo
160 168
 
161 169
 			# Get path and depth
162 170
 
163
-			if (false !== ($path = $this->parent->getPath())) $this->path = $path;
171
+			if (false !== ($path = $this->parent->getPath())) {
172
+				$this->path = $path;
173
+			}
164 174
 
165
-			if ((0 !== $this->entity->id) && (false !== ($depth = $this->entity->getSubtreeDepth()))) $this->depth = $depth;
175
+			if ((0 !== $this->entity->id) && (false !== ($depth = $this->entity->getSubtreeDepth()))) {
176
+				$this->depth = $depth;
177
+			}
166 178
 
167 179
 			# Get items list
168 180
 
169 181
 			$lister = (static::$nesting ? 'getChildren' : 'getItems');
170 182
 
171
-			if (false !== ($items = $this->parent->$lister())) $this->items = $items;
183
+			if (false !== ($items = $this->parent->$lister())) {
184
+				$this->items = $items;
185
+			}
172 186
 
173 187
 			# ------------------------
174 188
 
@@ -183,7 +197,9 @@  discard block
 block discarded – undo
183 197
 
184 198
 		protected function handle(bool $ajax = false) {
185 199
 
186
-			if ($ajax) return $this->handleAjax();
200
+			if ($ajax) {
201
+				return $this->handleAjax();
202
+			}
187 203
 
188 204
 			$this->index = Number::forceInt(Request::get('index'), 1, 999999);
189 205
 
@@ -195,13 +211,17 @@  discard block
 block discarded – undo
195 211
 
196 212
 			# Get path
197 213
 
198
-			if (false !== ($path = $this->parent->getPath())) $this->path = $path;
214
+			if (false !== ($path = $this->parent->getPath())) {
215
+				$this->path = $path;
216
+			}
199 217
 
200 218
 			# Get items list
201 219
 
202 220
 			$lister = (static::$nesting ? 'getChildren' : 'getItems'); $display = Settings::get('admin_display_entities');
203 221
 
204
-			if (false !== ($items = $this->parent->$lister([], [], $this->index, $display))) $this->items = $items;
222
+			if (false !== ($items = $this->parent->$lister([], [], $this->index, $display))) {
223
+				$this->items = $items;
224
+			}
205 225
 
206 226
 			# ------------------------
207 227
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Entitizer/Controller/Page.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,11 +44,15 @@
 block discarded – undo
44 44
 			$data['contents']           = $contents;
45 45
 			$data['time_modified']      = REQUEST_TIME;
46 46
 
47
-			if (0 === $this->page->id) $data['time_created'] = REQUEST_TIME;
47
+			if (0 === $this->page->id) {
48
+				$data['time_created'] = REQUEST_TIME;
49
+			}
48 50
 
49 51
 			$modifier = ((0 === $this->page->id) ? 'create' : 'edit');
50 52
 
51
-			if (!$this->page->$modifier($data)) return 'PAGE_ERROR_MODIFY';
53
+			if (!$this->page->$modifier($data)) {
54
+				return 'PAGE_ERROR_MODIFY';
55
+			}
52 56
 
53 57
 			# ------------------------
54 58
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 		/**
28 28
 		 * Invoker
29 29
 		 *
30
-		 * @return true|string : true on success or an error code on failure
30
+		 * @return string|boolean : true on success or an error code on failure
31 31
 		 */
32 32
 
33 33
 		public function __invoke(array $post) {
Please login to merge, or discard this patch.