Passed
Push — master ( e0d6a2...2ec881 )
by Anton
05:25 queued 02:20
created
www/engine/System/Classes/Modules/Settings/Utils/Dataset.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 			if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_URL;
23 23
 
24
-			return ((Request::isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
24
+			return ((Request::isSecure() ? 'https://' : 'http://').$_SERVER['HTTP_HOST']);
25 25
 		}
26 26
 
27 27
 		/**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 			if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_EMAIL;
34 34
 
35
-			return ('admin@' . $_SERVER['HTTP_HOST']);
35
+			return ('admin@'.$_SERVER['HTTP_HOST']);
36 36
 		}
37 37
 
38 38
 		/**
@@ -43,98 +43,98 @@  discard block
 block discarded – undo
43 43
 
44 44
 			# Site language
45 45
 
46
-			$this->addParam('site_language', CONFIG_SITE_LANGUAGE, function (string $name) {
46
+			$this->addParam('site_language', CONFIG_SITE_LANGUAGE, function(string $name) {
47 47
 
48 48
 				return ((false !== ($name = Extend\Languages::validate($name))) ? $name : null);
49 49
 			});
50 50
 
51 51
 			# Site template
52 52
 
53
-			$this->addParam('site_template', CONFIG_SITE_TEMPLATE, function (string $name) {
53
+			$this->addParam('site_template', CONFIG_SITE_TEMPLATE, function(string $name) {
54 54
 
55 55
 				return ((false !== ($name = Extend\Templates::validate($name))) ? $name : null);
56 56
 			});
57 57
 
58 58
 			# Site title
59 59
 
60
-			$this->addParam('site_title', CONFIG_SITE_TITLE, function (string $title) {
60
+			$this->addParam('site_title', CONFIG_SITE_TITLE, function(string $title) {
61 61
 
62 62
 				return (('' !== $title) ? $title : null);
63 63
 			});
64 64
 
65 65
 			# Site slogan
66 66
 
67
-			$this->addParam('site_slogan', CONFIG_SITE_SLOGAN, function (string $slogan) {
67
+			$this->addParam('site_slogan', CONFIG_SITE_SLOGAN, function(string $slogan) {
68 68
 
69 69
 				return $slogan;
70 70
 			});
71 71
 
72 72
 			# Site status
73 73
 
74
-			$this->addParam('site_status', CONFIG_SITE_STATUS, function (int $status) {
74
+			$this->addParam('site_status', CONFIG_SITE_STATUS, function(int $status) {
75 75
 
76 76
 				return ((false !== ($status = Range\Status::validate($status))) ? $status : null);
77 77
 			});
78 78
 
79 79
 			# Site description
80 80
 
81
-			$this->addParam('site_description', CONFIG_SITE_DESCRIPTION, function (string $description) {
81
+			$this->addParam('site_description', CONFIG_SITE_DESCRIPTION, function(string $description) {
82 82
 
83 83
 				return $description;
84 84
 			});
85 85
 
86 86
 			# Site keywords
87 87
 
88
-			$this->addParam('site_keywords', CONFIG_SITE_KEYWORDS, function (string $keywords) {
88
+			$this->addParam('site_keywords', CONFIG_SITE_KEYWORDS, function(string $keywords) {
89 89
 
90 90
 				return $keywords;
91 91
 			});
92 92
 
93 93
 			# System url
94 94
 
95
-			$this->addParam('system_url', $this->getSystemUrl(), function (string $url) {
95
+			$this->addParam('system_url', $this->getSystemUrl(), function(string $url) {
96 96
 
97 97
 				return ((false !== ($url = Validate::url($url))) ? $url : null);
98 98
 			});
99 99
 
100 100
 			# System email
101 101
 
102
-			$this->addParam('system_email', $this->getSystemEmail(), function (string $email) {
102
+			$this->addParam('system_email', $this->getSystemEmail(), function(string $email) {
103 103
 
104 104
 				return ((false !== ($email = Validate::email($email))) ? $email : null);
105 105
 			});
106 106
 
107 107
 			# System timezone
108 108
 
109
-			$this->addParam('system_timezone', CONFIG_SYSTEM_TIMEZONE, function (string $timezone) {
109
+			$this->addParam('system_timezone', CONFIG_SYSTEM_TIMEZONE, function(string $timezone) {
110 110
 
111 111
 				return ((false !== ($timezone = Timezone::validate($timezone))) ? $timezone : null);
112 112
 			});
113 113
 
114 114
 			# Admin language
115 115
 
116
-			$this->addParam('admin_language', CONFIG_ADMIN_LANGUAGE, function (string $name) {
116
+			$this->addParam('admin_language', CONFIG_ADMIN_LANGUAGE, function(string $name) {
117 117
 
118 118
 				return ((false !== ($name = Extend\Languages::validate($name))) ? $name : null);
119 119
 			});
120 120
 
121 121
 			# Admin template
122 122
 
123
-			$this->addParam('admin_template', CONFIG_ADMIN_TEMPLATE, function (string $name) {
123
+			$this->addParam('admin_template', CONFIG_ADMIN_TEMPLATE, function(string $name) {
124 124
 
125 125
 				return ((false !== ($name = Extend\Templates::validate($name))) ? $name : null);
126 126
 			});
127 127
 
128 128
 			# Admin display entities
129 129
 
130
-			$this->addParam('admin_display_entities', CONFIG_ADMIN_DISPLAY_ENTITIES, function (int $display) {
130
+			$this->addParam('admin_display_entities', CONFIG_ADMIN_DISPLAY_ENTITIES, function(int $display) {
131 131
 
132 132
 				return ((false !== ($display = Range\Display\Entities::validate($display))) ? $display : null);
133 133
 			});
134 134
 
135 135
 			# Admin display files
136 136
 
137
-			$this->addParam('admin_display_files', CONFIG_ADMIN_DISPLAY_FILES, function (int $display) {
137
+			$this->addParam('admin_display_files', CONFIG_ADMIN_DISPLAY_FILES, function(int $display) {
138 138
 
139 139
 				return ((false !== ($display = Range\Display\Files::validate($display))) ? $display : null);
140 140
 			});
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 		private function getSystemUrl() : string {
21 21
 
22
-			if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_URL;
22
+			if (empty($_SERVER['HTTP_HOST'])) {
23
+				return CONFIG_SYSTEM_URL;
24
+			}
23 25
 
24 26
 			return ((Request::isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
25 27
 		}
@@ -30,7 +32,9 @@  discard block
 block discarded – undo
30 32
 
31 33
 		private function getSystemEmail() : string {
32 34
 
33
-			if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_EMAIL;
35
+			if (empty($_SERVER['HTTP_HOST'])) {
36
+				return CONFIG_SYSTEM_EMAIL;
37
+			}
34 38
 
35 39
 			return ('admin@' . $_SERVER['HTTP_HOST']);
36 40
 		}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Handler/Upload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
 
23 23
 			# Save uploaded file
24 24
 
25
-			if (true === ($upload = (Uploader::save('upload', (DIR_UPLOADS . $target_dir))))) {
25
+			if (true === ($upload = (Uploader::save('upload', (DIR_UPLOADS.$target_dir))))) {
26 26
 
27
-				$name = Uploader::baseName(); $url = (INSTALL_PATH . '/uploads/' . $target_dir . $name);
27
+				$name = Uploader::baseName(); $url = (INSTALL_PATH.'/uploads/'.$target_dir.$name);
28 28
 
29 29
 				$ajax->set('name', $name)->set('url', $url);
30 30
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Handler/Lister.php 1 patch
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,15 +25,19 @@  discard block
 block discarded – undo
25 25
 
26 26
 				while (false !== ($name = readdir($handler))) {
27 27
 
28
-					if (in_array($name, ['.', '..', '.empty'], true)) continue;
28
+					if (in_array($name, ['.', '..', '.empty'], true)) {
29
+						continue;
30
+					}
29 31
 
30 32
 					$path = ($prefix . $name); $path_full = ($this->parent->pathFull() . $name);
31 33
 
32 34
 					$data = ['name' => $name, 'path' => $path, 'path_full' => $path_full];
33 35
 
34
-					if (@is_dir($path_full)) $dirs[] = ($data + ['type' => FILEMANAGER_TYPE_DIR]);
35
-
36
-					else if (@is_file($path_full)) $files[] = ($data + ['type' => FILEMANAGER_TYPE_FILE]);
36
+					if (@is_dir($path_full)) {
37
+						$dirs[] = ($data + ['type' => FILEMANAGER_TYPE_DIR]);
38
+					} else if (@is_file($path_full)) {
39
+						$files[] = ($data + ['type' => FILEMANAGER_TYPE_FILE]);
40
+					}
37 41
 				}
38 42
 
39 43
 				closedir($handler);
@@ -135,9 +139,11 @@  discard block
 block discarded – undo
135 139
 
136 140
 			foreach ($this->items['list'] as $item) {
137 141
 
138
-				if ($item['type'] === FILEMANAGER_TYPE_DIR) $items->addItem($this->getDirItemBlock($item));
139
-
140
-				else if ($item['type'] === FILEMANAGER_TYPE_FILE) $items->addItem($this->getFileItemBlock($item));
142
+				if ($item['type'] === FILEMANAGER_TYPE_DIR) {
143
+					$items->addItem($this->getDirItemBlock($item));
144
+				} else if ($item['type'] === FILEMANAGER_TYPE_FILE) {
145
+					$items->addItem($this->getFileItemBlock($item));
146
+				}
141 147
 			}
142 148
 
143 149
 			# Set pagination
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Utils/Handler.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,9 @@  discard block
 block discarded – undo
56 56
 
57 57
 			if (Request::post('action') === 'remove') {
58 58
 
59
-				if (!$this->entity->remove()) return $ajax->setError(Language::get(static::$message_error_remove));
59
+				if (!$this->entity->remove()) {
60
+					return $ajax->setError(Language::get(static::$message_error_remove));
61
+				}
60 62
 			}
61 63
 
62 64
 			# ------------------------
@@ -78,7 +80,9 @@  discard block
 block discarded – undo
78 80
 
79 81
 			# Handle ajax request
80 82
 
81
-			if ($ajax) return $this->handleAjax();
83
+			if ($ajax) {
84
+				return $this->handleAjax();
85
+			}
82 86
 
83 87
 			# Init entity
84 88
 
@@ -104,7 +108,9 @@  discard block
 block discarded – undo
104 108
 
105 109
 			# Display success message
106 110
 
107
-			if (false !== Request::get('submitted')) Popup::set('positive', Language::get(static::$message_success_rename));
111
+			if (false !== Request::get('submitted')) {
112
+				Popup::set('positive', Language::get(static::$message_success_rename));
113
+			}
108 114
 
109 115
 			# ------------------------
110 116
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Page.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,9 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 			# Set breadcrumbs
27 27
 
28
-			if (count($this->path) <= 1) $contents->getBlock('breadcrumbs')->disable();
29
-
30
-			else $contents->getBlock('breadcrumbs')->path = $this->path;
28
+			if (count($this->path) <= 1) {
29
+				$contents->getBlock('breadcrumbs')->disable();
30
+			} else {
31
+				$contents->getBlock('breadcrumbs')->path = $this->path;
32
+			}
31 33
 
32 34
 			# Set contents
33 35
 
@@ -54,19 +56,31 @@  discard block
 block discarded – undo
54 56
 
55 57
 			$slug = $this->_url->getSlug();
56 58
 
57
-			if ('' !== $slug) $this->page->initBySlug($slug); else $this->page->init(1);
59
+			if ('' !== $slug) {
60
+				$this->page->initBySlug($slug);
61
+			} else {
62
+				$this->page->init(1);
63
+			}
58 64
 
59 65
 			# Display error if not found
60 66
 
61
-			if (0 === $this->page->id) return false;
67
+			if (0 === $this->page->id) {
68
+				return false;
69
+			}
62 70
 
63 71
 			# Get path
64 72
 
65
-			if (false !== ($path = $this->page->path())) $this->path = $path;
73
+			if (false !== ($path = $this->page->path())) {
74
+				$this->path = $path;
75
+			}
66 76
 
67 77
 			# Set data
68 78
 
69
-			if ($this->page->id !== 1) SEO::title($this->page->title); else $this->_layout = 'Index';
79
+			if ($this->page->id !== 1) {
80
+				SEO::title($this->page->title);
81
+			} else {
82
+				$this->_layout = 'Index';
83
+			}
70 84
 
71 85
 			SEO::description        ($this->page->description);
72 86
 			SEO::keywords           ($this->page->keywords);
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Install/Controller/Database.php 1 patch
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,21 +31,19 @@  discard block
 block discarded – undo
31 31
 
32 32
 			# Connect to DB
33 33
 
34
-			try { DB::connect($server, $user, $password, $name); }
35
-
36
-			catch (Exception\DBConnect $error) { return 'INSTALL_ERROR_DATABASE_CONNECT'; }
37
-
38
-			catch (Exception\DBCharset $error) { return 'INSTALL_ERROR_DATABASE_CHARSET'; }
39
-
40
-			catch (Exception\DBSelect $error) { return 'INSTALL_ERROR_DATABASE_SELECT'; }
34
+			try { DB::connect($server, $user, $password, $name); } catch (Exception\DBConnect $error) { return 'INSTALL_ERROR_DATABASE_CONNECT'; } catch (Exception\DBCharset $error) { return 'INSTALL_ERROR_DATABASE_CHARSET'; } catch (Exception\DBSelect $error) { return 'INSTALL_ERROR_DATABASE_SELECT'; }
41 35
 
42 36
 			# Create tables
43 37
 
44
-			if (!Install\Utils\Tables::create()) return 'INSTALL_ERROR_DATABASE_TABLES_CREATE';
38
+			if (!Install\Utils\Tables::create()) {
39
+				return 'INSTALL_ERROR_DATABASE_TABLES_CREATE';
40
+			}
45 41
 
46 42
 			# Fill tables
47 43
 
48
-			if (!Install\Utils\Tables::fill()) return 'INSTALL_ERROR_DATABASE_TABLES_FILL';
44
+			if (!Install\Utils\Tables::fill()) {
45
+				return 'INSTALL_ERROR_DATABASE_TABLES_FILL';
46
+			}
49 47
 
50 48
 			# Save system file
51 49
 
@@ -58,7 +56,9 @@  discard block
 block discarded – undo
58 56
 
59 57
 			$system['time'] = REQUEST_TIME;
60 58
 
61
-			if (!Schema::get('System')->save($system)) return 'INSTALL_ERROR_SYSTEM';
59
+			if (!Schema::get('System')->save($system)) {
60
+				return 'INSTALL_ERROR_SYSTEM';
61
+			}
62 62
 
63 63
 			# ------------------------
64 64
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Install/Install.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 		public static function checkInstallFile() {
26 26
 
27
-			return Explorer::isFile(DIR_WWW . 'install.php');
27
+			return Explorer::isFile(DIR_WWW.'install.php');
28 28
 		}
29 29
 
30 30
 		# Get MySQL version
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Install/Handler/Check.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
 				$class = ($status ? 'positive' : 'negative'); $icon = ($status ? 'check circle' : 'warning circle');
31 31
 
32
-				$text = Language::get('INSTALL_REQUIREMENT_' . strtoupper($name) . '_' . ($status ? 'SUCCESS' : 'FAIL'));
32
+				$text = Language::get('INSTALL_REQUIREMENT_'.strtoupper($name).'_'.($status ? 'SUCCESS' : 'FAIL'));
33 33
 
34 34
 				$requirements[] = ['class' => $class, 'icon' => $icon, 'text' => $text];
35 35
 			}
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Informer/Handler/Information.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 			# Set server entries
25 25
 
26
-			$contents->os_version           = (php_uname('s') . ', ' . php_uname('v'));
26
+			$contents->os_version           = (php_uname('s').', '.php_uname('v'));
27 27
 
28 28
 			$contents->php_version          = phpversion();
29 29
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 			$contents->debug_mode_class     = (DEBUG_MODE ? 'red' : 'grey');
37 37
 
38
-			$contents->debug_mode_value     = Language::get('INFORMATION_VALUE_DEBUG_MODE_' . (DEBUG_MODE ? 'ON' : 'OFF'));
38
+			$contents->debug_mode_value     = Language::get('INFORMATION_VALUE_DEBUG_MODE_'.(DEBUG_MODE ? 'ON' : 'OFF'));
39 39
 
40 40
 			# Set third-party entries
41 41
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		private function setPhpEntries(Template\Block $contents) {
54 54
 
55
-			$status_value = function (string $value) { return (Validate::boolean($value) ? 'On' : 'Off'); };
55
+			$status_value = function(string $value) { return (Validate::boolean($value) ? 'On' : 'Off'); };
56 56
 
57 57
 			# Set errors entries
58 58
 
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 
82 82
 		private function setDiagnosticsEntries(Template\Block $contents) {
83 83
 
84
-			$extension_value = function (bool $value) {
84
+			$extension_value = function(bool $value) {
85 85
 
86
-				return Language::get('INFORMATION_VALUE_EXTENSION_' . (!$value ? 'NOT_' : '') . 'LOADED' );
86
+				return Language::get('INFORMATION_VALUE_EXTENSION_'.(!$value ? 'NOT_' : '').'LOADED');
87 87
 			};
88 88
 
89
-			$dir_value = function (bool $value) {
89
+			$dir_value = function(bool $value) {
90 90
 
91
-				return Language::get('INFORMATION_VALUE_DIR_' . (!$value ? 'NOT_' : '') . 'WRITABLE' );
91
+				return Language::get('INFORMATION_VALUE_DIR_'.(!$value ? 'NOT_' : '').'WRITABLE');
92 92
 			};
93 93
 
94 94
 			# Get loops
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 			foreach (Install::getExtensions() as $name => $status) {
101 101
 
102
-				$name = Language::get('INFORMATION_ROW_EXTENSION_' . strtoupper($name));
102
+				$name = Language::get('INFORMATION_ROW_EXTENSION_'.strtoupper($name));
103 103
 
104 104
 				$class = ($status ? 'green' : 'red'); $value = $extension_value($status);
105 105
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 			foreach (Install::getDirs() as $name => $status) {
112 112
 
113
-				$name = Language::get('INFORMATION_ROW_DIR_' . strtoupper($name));
113
+				$name = Language::get('INFORMATION_ROW_DIR_'.strtoupper($name));
114 114
 
115 115
 				$class = ($status ? 'green' : 'red'); $value = $dir_value($status);
116 116
 
Please login to merge, or discard this patch.