Test Setup Failed
Push — master ( c5be4a...39e959 )
by Anton
02:54
created
www/engine/System/Classes/Frames/Section.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 			foreach (array_unique($languages) as $path) foreach ($phrases as $name) {
36 36
 
37
-				Language::load($path . 'Phrases/' . $name . '.php');
37
+				Language::load($path.'Phrases/'.$name.'.php');
38 38
 			}
39 39
 		}
40 40
 
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 
45 45
 		private function setGlobals() {
46 46
 
47
-			Template::setGlobal('cadmium_home',         CADMIUM_HOME);
48
-			Template::setGlobal('cadmium_copy',         CADMIUM_COPY);
49
-			Template::setGlobal('cadmium_name',         CADMIUM_NAME);
50
-			Template::setGlobal('cadmium_version',      CADMIUM_VERSION);
47
+			Template::setGlobal('cadmium_home', CADMIUM_HOME);
48
+			Template::setGlobal('cadmium_copy', CADMIUM_COPY);
49
+			Template::setGlobal('cadmium_name', CADMIUM_NAME);
50
+			Template::setGlobal('cadmium_version', CADMIUM_VERSION);
51 51
 
52
-			Template::setGlobal('template_name',        strtolower(Extend\Templates::get('name')));
52
+			Template::setGlobal('template_name', strtolower(Extend\Templates::get('name')));
53 53
 
54
-			Template::setGlobal('site_title',           Settings::get('site_title'));
55
-			Template::setGlobal('site_slogan',          Settings::get('site_slogan'));
54
+			Template::setGlobal('site_title', Settings::get('site_title'));
55
+			Template::setGlobal('site_slogan', Settings::get('site_slogan'));
56 56
 
57
-			Template::setGlobal('system_url',           Settings::get('system_url'));
58
-			Template::setGlobal('system_email',         Settings::get('system_email'));
57
+			Template::setGlobal('system_url', Settings::get('system_url'));
58
+			Template::setGlobal('system_email', Settings::get('system_email'));
59 59
 
60
-			Template::setGlobal('install_path',         INSTALL_PATH);
60
+			Template::setGlobal('install_path', INSTALL_PATH);
61 61
 
62
-			Template::setGlobal('index_page',           (('' !== INSTALL_PATH) ? INSTALL_PATH : '/'));
62
+			Template::setGlobal('index_page', (('' !== INSTALL_PATH) ? INSTALL_PATH : '/'));
63 63
 
64
-			Template::setGlobal('current_year',         Date::getYear());
64
+			Template::setGlobal('current_year', Date::getYear());
65 65
 		}
66 66
 
67 67
 		/**
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,10 +32,12 @@  discard block
 block discarded – undo
32 32
 
33 33
 			$phrases = array_merge(static::PHRASES, array_keys(Extend\Addons::getItems() ?? []));
34 34
 
35
-			foreach (array_unique($languages) as $path) foreach ($phrases as $name) {
35
+			foreach (array_unique($languages) as $path) {
36
+				foreach ($phrases as $name) {
36 37
 
37 38
 				Language::load($path . 'Phrases/' . $name . '.php');
38 39
 			}
40
+			}
39 41
 		}
40 42
 
41 43
 		/**
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
 
87 89
 			# Set timezone
88 90
 
89
-			if (Auth::isLogged() && ('' !== ($timezone = Auth::get('timezone')))) date_default_timezone_set($timezone);
91
+			if (Auth::isLogged() && ('' !== ($timezone = Auth::get('timezone')))) {
92
+				date_default_timezone_set($timezone);
93
+			}
90 94
 
91 95
 			# Init utils
92 96
 
Please login to merge, or discard this patch.
www/engine/System/Classes/Frames/Site/View.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 		private function getLayout(Template\Block $contents) : Template\Block {
24 24
 
25
-			$layout = View::get('Layouts/' . $this->layout);
25
+			$layout = View::get('Layouts/'.$this->layout);
26 26
 
27 27
 			# Set menu
28 28
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 			$title = (SEO::get('title') ?: Language::get($this->title) ?: '');
80 80
 
81
-			$page->title = ((('' !== $title) ? ($title . ' | ') : '') . Settings::get('site_title'));
81
+			$page->title = ((('' !== $title) ? ($title.' | ') : '').Settings::get('site_title'));
82 82
 
83 83
 			# Set canonical
84 84
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 
39 39
 				$layout->getBlock('user')->name = Auth::get('name');
40 40
 
41
-				if (Auth::get('rank') === RANK_ADMINISTRATOR) $layout->getBlock('admin')->enable();
41
+				if (Auth::get('rank') === RANK_ADMINISTRATOR) {
42
+					$layout->getBlock('admin')->enable();
43
+				}
42 44
 			}
43 45
 
44 46
 			# Set title
@@ -82,7 +84,9 @@  discard block
 block discarded – undo
82 84
 
83 85
 			# Set canonical
84 86
 
85
-			if (false !== SEO::get('canonical')) $page->getBlock('canonical')->enable()->link = SEO::get('canonical');
87
+			if (false !== SEO::get('canonical')) {
88
+				$page->getBlock('canonical')->enable()->link = SEO::get('canonical');
89
+			}
86 90
 
87 91
 			# Set layout
88 92
 
@@ -90,9 +94,13 @@  discard block
 block discarded – undo
90 94
 
91 95
 			# Set global components
92 96
 
93
-			foreach (Variables::generate() as $name => $value) Template::setGlobal($name, $value);
97
+			foreach (Variables::generate() as $name => $value) {
98
+				Template::setGlobal($name, $value);
99
+			}
94 100
 
95
-			foreach (Widgets::generate() as $name => $block) Template::setWidget($name, $block);
101
+			foreach (Widgets::generate() as $name => $block) {
102
+				Template::setWidget($name, $block);
103
+			}
96 104
 
97 105
 			# ------------------------
98 106
 
Please login to merge, or discard this patch.
www/engine/Framework/Engine.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 
18 18
 		private static function parseContents(string $contents, Throwable $exc) : string {
19 19
 
20
-		   $contents = str_replace('$message$',             $exc->getMessage(),                 $contents);
20
+		   $contents = str_replace('$message$', $exc->getMessage(), $contents);
21 21
 
22
-		   $contents = str_replace('$file$',                $exc->getFile(),                    $contents);
22
+		   $contents = str_replace('$file$', $exc->getFile(), $contents);
23 23
 
24
-		   $contents = str_replace('$line$',                $exc->getLine(),                    $contents);
24
+		   $contents = str_replace('$line$', $exc->getLine(), $contents);
25 25
 
26
-		   $contents = str_replace('$trace$',               nl2br($exc->getTraceAsString()),    $contents);
26
+		   $contents = str_replace('$trace$', nl2br($exc->getTraceAsString()), $contents);
27 27
 
28 28
 		   # ------------------------
29 29
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 			# Load template
63 63
 
64
-			$file_name = (DIR_TEMPLATES . 'Exception.ctp');
64
+			$file_name = (DIR_TEMPLATES.'Exception.ctp');
65 65
 
66 66
 			if (false === ($contents = @file_get_contents($file_name))) $output = nl2br($exc);
67 67
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 			header('Pragma: no-cache');
79 79
 
80
-			header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
80
+			header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error', true, 500);
81 81
 
82 82
 			header('Content-type: text/html; charset=UTF-8');
83 83
 
Please login to merge, or discard this patch.
Braces   +23 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,17 +36,29 @@  discard block
 block discarded – undo
36 36
 
37 37
 		public static function getIP() : string {
38 38
 
39
-			if (!empty($_SERVER['HTTP_CLIENT_IP']))         return $_SERVER['HTTP_CLIENT_IP'];
39
+			if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
40
+				return $_SERVER['HTTP_CLIENT_IP'];
41
+			}
40 42
 
41
-			if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))   return $_SERVER['HTTP_X_FORWARDED_FOR'];
43
+			if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
44
+				return $_SERVER['HTTP_X_FORWARDED_FOR'];
45
+			}
42 46
 
43
-			if (!empty($_SERVER['HTTP_X_FORWARDED']))       return $_SERVER['HTTP_X_FORWARDED'];
47
+			if (!empty($_SERVER['HTTP_X_FORWARDED'])) {
48
+				return $_SERVER['HTTP_X_FORWARDED'];
49
+			}
44 50
 
45
-			if (!empty($_SERVER['HTTP_FORWARDED_FOR']))     return $_SERVER['HTTP_FORWARDED_FOR'];
51
+			if (!empty($_SERVER['HTTP_FORWARDED_FOR'])) {
52
+				return $_SERVER['HTTP_FORWARDED_FOR'];
53
+			}
46 54
 
47
-			if (!empty($_SERVER['HTTP_FORWARDED']))         return $_SERVER['HTTP_FORWARDED'];
55
+			if (!empty($_SERVER['HTTP_FORWARDED'])) {
56
+				return $_SERVER['HTTP_FORWARDED'];
57
+			}
48 58
 
49
-			if (!empty($_SERVER['REMOTE_ADDR']))            return $_SERVER['REMOTE_ADDR'];
59
+			if (!empty($_SERVER['REMOTE_ADDR'])) {
60
+				return $_SERVER['REMOTE_ADDR'];
61
+			}
50 62
 
51 63
 			# ------------------------
52 64
 
@@ -63,9 +75,11 @@  discard block
 block discarded – undo
63 75
 
64 76
 			$file_name = (DIR_TEMPLATES . 'Exception.ctp');
65 77
 
66
-			if (false === ($contents = @file_get_contents($file_name))) $output = nl2br($exc);
67
-
68
-			else $output = self::parseContents($contents, $exc);
78
+			if (false === ($contents = @file_get_contents($file_name))) {
79
+				$output = nl2br($exc);
80
+			} else {
81
+				$output = self::parseContents($contents, $exc);
82
+			}
69 83
 
70 84
 			# Set headers
71 85
 
Please login to merge, or discard this patch.
www/engine/System/Includes/Constants.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -9,64 +9,64 @@
 block discarded – undo
9 9
 
10 10
 # Cadmium
11 11
 
12
-define('CADMIUM_NAME',                              'Cadmium CMS');
13
-define('CADMIUM_HOME',                              'http://cadmium-cms.com');
12
+define('CADMIUM_NAME', 'Cadmium CMS');
13
+define('CADMIUM_HOME', 'http://cadmium-cms.com');
14 14
 
15
-define('CADMIUM_VERSION',                           '0.4.8');
16
-define('CADMIUM_COPY',                              '2017');
15
+define('CADMIUM_VERSION', '0.4.8');
16
+define('CADMIUM_COPY', '2017');
17 17
 
18 18
 # Third-party
19 19
 
20
-define('JQUERY_VERSION',                            '3.2.1');
21
-define('SEMANTIC_UI_VERSION',                       '2.2.10');
22
-define('CKEDITOR_VERSION',                          '4.6.2');
23
-define('ACE_VERSION',                               '1.2.6');
20
+define('JQUERY_VERSION', '3.2.1');
21
+define('SEMANTIC_UI_VERSION', '2.2.10');
22
+define('CKEDITOR_VERSION', '4.6.2');
23
+define('ACE_VERSION', '1.2.6');
24 24
 
25 25
 # Sections
26 26
 
27
-define('SECTION_SITE',                              'site');
28
-define('SECTION_ADMIN',                             'admin');
27
+define('SECTION_SITE', 'site');
28
+define('SECTION_ADMIN', 'admin');
29 29
 
30 30
 # Access
31 31
 
32
-define('ACCESS_PUBLIC',                             0);
33
-define('ACCESS_REGISTERED',                         1);
34
-define('ACCESS_ADMINISTRATOR',                      2);
32
+define('ACCESS_PUBLIC', 0);
33
+define('ACCESS_REGISTERED', 1);
34
+define('ACCESS_ADMINISTRATOR', 2);
35 35
 
36 36
 # Frequency
37 37
 
38
-define('FREQUENCY_ALWAYS',                          'always');
39
-define('FREQUENCY_HOURLY',                          'hourly');
40
-define('FREQUENCY_DAILY',                           'daily');
41
-define('FREQUENCY_WEEKLY',                          'weekly');
42
-define('FREQUENCY_MONTHLY',                         'monthly');
43
-define('FREQUENCY_YEARLY',                          'yearly');
44
-define('FREQUENCY_NEVER',                           'never');
38
+define('FREQUENCY_ALWAYS', 'always');
39
+define('FREQUENCY_HOURLY', 'hourly');
40
+define('FREQUENCY_DAILY', 'daily');
41
+define('FREQUENCY_WEEKLY', 'weekly');
42
+define('FREQUENCY_MONTHLY', 'monthly');
43
+define('FREQUENCY_YEARLY', 'yearly');
44
+define('FREQUENCY_NEVER', 'never');
45 45
 
46 46
 # Rank
47 47
 
48
-define('RANK_GUEST',                                0);
49
-define('RANK_USER',                                 1);
50
-define('RANK_ADMINISTRATOR',                        2);
48
+define('RANK_GUEST', 0);
49
+define('RANK_USER', 1);
50
+define('RANK_ADMINISTRATOR', 2);
51 51
 
52 52
 # Sex
53 53
 
54
-define('SEX_NOT_SELECTED',                          0);
55
-define('SEX_MALE',                                  1);
56
-define('SEX_FEMALE',                                2);
54
+define('SEX_NOT_SELECTED', 0);
55
+define('SEX_MALE', 1);
56
+define('SEX_FEMALE', 2);
57 57
 
58 58
 # Status
59 59
 
60
-define('STATUS_ONLINE',                             0);
61
-define('STATUS_MAINTENANCE',                        1);
62
-define('STATUS_UPDATE',                             2);
60
+define('STATUS_ONLINE', 0);
61
+define('STATUS_MAINTENANCE', 1);
62
+define('STATUS_UPDATE', 2);
63 63
 
64 64
 # Target
65 65
 
66
-define('TARGET_SELF',                               0);
67
-define('TARGET_BLANK',                              1);
66
+define('TARGET_SELF', 0);
67
+define('TARGET_BLANK', 1);
68 68
 
69 69
 # Visibility
70 70
 
71
-define('VISIBILITY_DRAFT',                          0);
72
-define('VISIBILITY_PUBLISHED',                      1);
71
+define('VISIBILITY_DRAFT', 0);
72
+define('VISIBILITY_PUBLISHED', 1);
Please login to merge, or discard this patch.
www/engine/System/Classes/Modules/Filemanager/Container/Templates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 
16 16
 		use Filemanager\Common\Templates;
17 17
 
18
-		protected $path_full = (DIR_SYSTEM_TEMPLATES . 'Site/');
18
+		protected $path_full = (DIR_SYSTEM_TEMPLATES.'Site/');
19 19
 	}
20 20
 }
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 		protected function getValue(string $value) : string {
32 32
 
33
-			return ('\'' . addslashes($value) . '\'');
33
+			return ('\''.addslashes($value).'\'');
34 34
 		}
35 35
 
36 36
 		/**
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 		protected function getRange(array $value) : string {
41 41
 
42
-			$parser = function ($value) { if (is_scalar($value)) return $this->getValue($value); };
42
+			$parser = function($value) { if (is_scalar($value)) return $this->getValue($value); };
43 43
 
44
-			return ('(' . implode(', ', array_filter(array_map($parser, $value))) . ')');
44
+			return ('('.implode(', ', array_filter(array_map($parser, $value))).')');
45 45
 		}
46 46
 
47 47
 		/**
@@ -50,21 +50,21 @@  discard block
 block discarded – undo
50 50
 
51 51
 		protected function getOperatable($value) {
52 52
 
53
-			if (is_scalar($value)) return ('= ' . $this->getValue($value));
53
+			if (is_scalar($value)) return ('= '.$this->getValue($value));
54 54
 
55
-			if (is_array($value)) return ('IN ' . $this->getRange($value));
55
+			if (is_array($value)) return ('IN '.$this->getRange($value));
56 56
 
57
-			if ($value instanceof Type\Not) return ('NOT ' . $this->getValue($value->get()));
57
+			if ($value instanceof Type\Not) return ('NOT '.$this->getValue($value->get()));
58 58
 
59
-			if ($value instanceof Type\Like) return ('LIKE ' . $this->getValue($value->get()));
59
+			if ($value instanceof Type\Like) return ('LIKE '.$this->getValue($value->get()));
60 60
 
61
-			if ($value instanceof Type\LessThan) return ('< ' . $value->get());
61
+			if ($value instanceof Type\LessThan) return ('< '.$value->get());
62 62
 
63
-			if ($value instanceof Type\GreaterThan) return ('> ' . $value->get());
63
+			if ($value instanceof Type\GreaterThan) return ('> '.$value->get());
64 64
 
65
-			if ($value instanceof Type\LessThanOrEqual) return ('<= ' . $value->get());
65
+			if ($value instanceof Type\LessThanOrEqual) return ('<= '.$value->get());
66 66
 
67
-			if ($value instanceof Type\GreaterThanOrEqual) return ('>= ' . $value->get());
67
+			if ($value instanceof Type\GreaterThanOrEqual) return ('>= '.$value->get());
68 68
 
69 69
 			# ------------------------
70 70
 
Please login to merge, or discard this patch.
Braces   +39 added lines, -13 removed lines patch added patch discarded remove patch
@@ -39,7 +39,10 @@  discard block
 block discarded – undo
39 39
 
40 40
 		protected function getRange(array $value) : string {
41 41
 
42
-			$parser = function ($value) { if (is_scalar($value)) return $this->getValue($value); };
42
+			$parser = function ($value) { if (is_scalar($value)) {
43
+				return $this->getValue($value);
44
+			}
45
+			};
43 46
 
44 47
 			return ('(' . implode(', ', array_filter(array_map($parser, $value))) . ')');
45 48
 		}
@@ -50,21 +53,37 @@  discard block
 block discarded – undo
50 53
 
51 54
 		protected function getOperatable($value) {
52 55
 
53
-			if (is_scalar($value)) return ('= ' . $this->getValue($value));
56
+			if (is_scalar($value)) {
57
+				return ('= ' . $this->getValue($value));
58
+			}
54 59
 
55
-			if (is_array($value)) return ('IN ' . $this->getRange($value));
60
+			if (is_array($value)) {
61
+				return ('IN ' . $this->getRange($value));
62
+			}
56 63
 
57
-			if ($value instanceof Type\Not) return ('NOT ' . $this->getValue($value->get()));
64
+			if ($value instanceof Type\Not) {
65
+				return ('NOT ' . $this->getValue($value->get()));
66
+			}
58 67
 
59
-			if ($value instanceof Type\Like) return ('LIKE ' . $this->getValue($value->get()));
68
+			if ($value instanceof Type\Like) {
69
+				return ('LIKE ' . $this->getValue($value->get()));
70
+			}
60 71
 
61
-			if ($value instanceof Type\LessThan) return ('< ' . $value->get());
72
+			if ($value instanceof Type\LessThan) {
73
+				return ('< ' . $value->get());
74
+			}
62 75
 
63
-			if ($value instanceof Type\GreaterThan) return ('> ' . $value->get());
76
+			if ($value instanceof Type\GreaterThan) {
77
+				return ('> ' . $value->get());
78
+			}
64 79
 
65
-			if ($value instanceof Type\LessThanOrEqual) return ('<= ' . $value->get());
80
+			if ($value instanceof Type\LessThanOrEqual) {
81
+				return ('<= ' . $value->get());
82
+			}
66 83
 
67
-			if ($value instanceof Type\GreaterThanOrEqual) return ('>= ' . $value->get());
84
+			if ($value instanceof Type\GreaterThanOrEqual) {
85
+				return ('>= ' . $value->get());
86
+			}
68 87
 
69 88
 			# ------------------------
70 89
 
@@ -86,7 +105,9 @@  discard block
 block discarded – undo
86 105
 
87 106
 		protected function getString($source = null, string $pattern = '', string $separator = '') : string {
88 107
 
89
-			if (!is_array($source)) return (is_scalar($source) ? strval($source) : '');
108
+			if (!is_array($source)) {
109
+				return (is_scalar($source) ? strval($source) : '');
110
+			}
90 111
 
91 112
 			$regexs = ['key' => '/\^([a-z]+)/', 'value' => '/\$([a-z]+)/']; $matches = ['key' => [], 'value' => []];
92 113
 
@@ -98,7 +119,9 @@  discard block
 block discarded – undo
98 119
 
99 120
 			# Parse pattern
100 121
 
101
-			foreach ($regexs as $name => $regex) preg_match($regex, $pattern, $matches[$name]);
122
+			foreach ($regexs as $name => $regex) {
123
+				preg_match($regex, $pattern, $matches[$name]);
124
+			}
102 125
 
103 126
 			# Process replacements
104 127
 
@@ -106,9 +129,12 @@  discard block
 block discarded – undo
106 129
 
107 130
 				$output[$count] = $pattern; $item = &$output[$count++];
108 131
 
109
-				foreach ($matches as $name => $match) if (isset($match[1]) && isset($parsers[$match[1]])) {
132
+				foreach ($matches as $name => $match) {
133
+					if (isset($match[1]) && isset($parsers[$match[1]])) {
110 134
 
111
-					try { $replace = [$this, $parsers[$match[1]]]($$name); } catch (\TypeError $e) { $replace = ''; }
135
+					try { $replace = [$this, $parsers[$match[1]]]($$name);
136
+				}
137
+				} catch (\TypeError $e) { $replace = ''; }
112 138
 
113 139
 					$item = str_replace($match[0], $replace, $item);
114 140
 				}
Please login to merge, or discard this patch.