Passed
Pull Request — master (#19)
by Anton
03:32
created
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.