Completed
Push — master ( 2c1eb1...6e4c54 )
by Justin
03:16
created
system/packages/com.jukusoft.cms.robots/classes/robots.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 
23 23
 	protected $robots = array();
24 24
 
25
-	public function __construct () {
25
+	public function __construct() {
26 26
 		//
27 27
 	}
28 28
 
29
-	public function loadFromDB () {
29
+	public function loadFromDB() {
30 30
 		$rows = DataBase::getInstance()->listRows("SELECT * FROM `{prefix}robots` WHERE `activated` = '1'; ");
31 31
 		$this->robots = $rows;
32 32
 	}
33 33
 
34
-	public function sortByUserAgent () {
34
+	public function sortByUserAgent() {
35 35
 		$array = array();
36 36
 
37 37
 		foreach ($this->robots as $row) {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		return $array;
46 46
 	}
47 47
 
48
-	public function writeFile () {
48
+	public function writeFile() {
49 49
 		$array = $this->sortByUserAgent();
50 50
 
51 51
 		if (!is_writable(ROOT_PATH . "robots.txt")) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		fclose($handle);
70 70
 	}
71 71
 
72
-	public function getContent () {
72
+	public function getContent() {
73 73
 		$array = $this->sortByUserAgent();
74 74
 
75 75
 		$buffer = "";
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		return $buffer;
88 88
 	}
89 89
 
90
-	public static function addRule (string $option, string $value, string $useragent = "*") {
90
+	public static function addRule(string $option, string $value, string $useragent = "*") {
91 91
 		Database::getInstance()->execute("INSERT INTO `{praefix}robots` (
92 92
 			`useragent`, `option`, `value`, `activated`
93 93
 		) VALUES (
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		));
100 100
 	}
101 101
 
102
-	public static function removeRule (string $option, string $value, string $useragent = "*") {
102
+	public static function removeRule(string $option, string $value, string $useragent = "*") {
103 103
 		Database::getInstance()->execute("DELETE FROM `{praefix}robots` WHERE `useragent` = :useragent AND `option` = :option AND `value` = :value; ", array(
104 104
 			'useragent' => $useragent,
105 105
 			'option' => $option,
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		));
108 108
 	}
109 109
 
110
-	public static function listRules () : array {
110
+	public static function listRules() : array {
111 111
 		$rows = Database::getInstance()->listRows("SELECT * FROM `{praefix}robots`; ");
112 112
 		return $rows;
113 113
 	}
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.permissions/classes/userrights.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		$this->load($userID);
40 40
 	}
41 41
 
42
-	protected function load (int $userID) {
42
+	protected function load(int $userID) {
43 43
 		if (Cache::contains("user_permissions", "user_" . $userID)) {
44 44
 			$this->permissions = Cache::get("user_permissions", "user_" . $userID);
45 45
 		} else {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 	}
63 63
 
64
-	public function setRight (string $token, int $value = 1) {
64
+	public function setRight(string $token, int $value = 1) {
65 65
 		//validate token
66 66
 		$token = Validator_Token::get($token);
67 67
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		Cache::clear("permissions", "permissions_user_" . $this->userID);
94 94
 	}
95 95
 
96
-	public function removeRight (string $token) {
96
+	public function removeRight(string $token) {
97 97
 		//validate token
98 98
 		$token = Validator_Token::get($token);
99 99
 
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 		Cache::clear("permissions", "permissions_user_" . $this->userID);
117 117
 	}
118 118
 
119
-	public function listRights () : array {
119
+	public function listRights() : array {
120 120
 		return $this->permissions;
121 121
 	}
122 122
 
123
-	public function hasRight (string $token) {
123
+	public function hasRight(string $token) {
124 124
 		return isset($this->permissions[$token]) && $this->permissions[$token] == 1;
125 125
 	}
126 126
 
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.permissions/classes/grouprights.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		$this->load($groupID);
40 40
 	}
41 41
 
42
-	protected function load (int $groupID) {
42
+	protected function load(int $groupID) {
43 43
 		if (Cache::contains("group_permissions", "group_" . $groupID)) {
44 44
 			$this->permissions = Cache::get("group_permissions", "group_" . $groupID);
45 45
 		} else {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 	}
63 63
 
64
-	public function setRight (string $token, int $value = 1) {
64
+	public function setRight(string $token, int $value = 1) {
65 65
 		//validate token
66 66
 		$token = Validator_Token::get($token);
67 67
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		Cache::clear("permissions");
94 94
 	}
95 95
 
96
-	public function removeRight (string $token) {
96
+	public function removeRight(string $token) {
97 97
 		//validate token
98 98
 		$token = Validator_Token::get($token);
99 99
 
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 		Cache::clear("permissions");
117 117
 	}
118 118
 
119
-	public function listRights () : array {
119
+	public function listRights() : array {
120 120
 		return $this->permissions;
121 121
 	}
122 122
 
123
-	public function hasRight (string $token) {
123
+	public function hasRight(string $token) {
124 124
 		return isset($this->permissions[$token]) && $this->permissions[$token] == 1;
125 125
 	}
126 126
 
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.jsbuilder/classes/jsqueeze.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
 		$varRx = '(?:[a-zA-Z_$])[a-zA-Z0-9_$]*',
79 79
 		$reserved = array(
80 80
 		// Literals
81
-		'true','false','null',
81
+		'true', 'false', 'null',
82 82
 		// ES6
83
-		'break','case','class','catch','const','continue','debugger','default','delete','do','else','export','extends','finally','for','function','if','import','in','instanceof','new','return','super','switch','this','throw','try','typeof','var','void','while','with','yield',
83
+		'break', 'case', 'class', 'catch', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'new', 'return', 'super', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield',
84 84
 		// Future
85 85
 		'enum',
86 86
 		// Strict mode
87
-		'implements','package','protected','static','let','interface','private','public',
87
+		'implements', 'package', 'protected', 'static', 'let', 'interface', 'private', 'public',
88 88
 		// Module
89 89
 		'await',
90 90
 		// Older standards
91
-		'abstract','boolean','byte','char','double','final','float','goto','int','long','native','short','synchronized','throws','transient','volatile',
91
+		'abstract', 'boolean', 'byte', 'char', 'double', 'final', 'float', 'goto', 'int', 'long', 'native', 'short', 'synchronized', 'throws', 'transient', 'volatile',
92 92
 	);
93 93
 
94 94
 	public function __construct()
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
 					if ("\n" != $f[$i]) {
248 248
 						isset($q[$f[$i]]) && ++$q[$f[$i]];
249
-						$s[] = '\\'.$f[$i];
249
+						$s[] = '\\' . $f[$i];
250 250
 					}
251 251
 				} elseif ('[' == $f[$i] && "/'" == $instr) {
252 252
 					$instr = '/[';
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					$s[] = ']';
257 257
 				} elseif ("'" == $f[$i] || '"' == $f[$i]) {
258 258
 					++$q[$f[$i]];
259
-					$s[] = '\\'.$f[$i];
259
+					$s[] = '\\' . $f[$i];
260 260
 				} else {
261 261
 					$s[] = $f[$i];
262 262
 				}
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 									}
313 313
 								}
314 314
 
315
-								$key = "//''\"\"".$K++.$instr = "/'";
315
+								$key = "//''\"\"" . $K++ . $instr = "/'";
316 316
 								$a = $j;
317 317
 								$code .= $key;
318 318
 								while (isset($key[++$j - $a - 1])) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 					case "'":
333 333
 					case '"':
334 334
 						$instr = $f[$i];
335
-						$key = "//''\"\"".$K++.('!' == $instr ? ']' : "'");
335
+						$key = "//''\"\"" . $K++ . ('!' == $instr ? ']' : "'");
336 336
 						$a = $j;
337 337
 						$code .= $key;
338 338
 						while (isset($key[++$j - $a - 1])) {
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		$code = preg_replace("'(\d)\s+\.\s*([a-zA-Z\$_[(])'", "$1\x7F.$2", $code);
389 389
 		$code = preg_replace("# ([-!%&;<=>~:.^+|,()*?[\]{}/']+)#", '$1', $code);
390 390
 		$code = preg_replace("#([-!%&;<=>~:.^+|,()*?[\]{}/]+) #", '$1', $code);
391
-		$cc_on && $code = preg_replace_callback("'//[^\'].*?@#3'", function ($m) { return strtr($m[0], ' ', "\x7F"); }, $code);
391
+		$cc_on && $code = preg_replace_callback("'//[^\'].*?@#3'", function($m) { return strtr($m[0], ' ', "\x7F"); }, $code);
392 392
 
393 393
 		// Replace new Array/Object by []/{}
394 394
 		false !== strpos($code, 'new Array') && $code = preg_replace("'new Array(?:\(\)|([;\])},:]))'", '[]$1', $code);
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
 
468 468
 				case '#':
469 469
 					switch ($f[$j]) {
470
-						case '1': $f[$j] = 'if';    break 2;
471
-						case '2': $f[$j] = 'for';   break 2;
470
+						case '1': $f[$j] = 'if'; break 2;
471
+						case '2': $f[$j] = 'for'; break 2;
472 472
 						case '3': $f[$j] = 'while'; break 2;
473 473
 					}
474 474
 
@@ -490,33 +490,33 @@  discard block
 block discarded – undo
490 490
 		$f = preg_replace("'(?<![\$.a-zA-Z0-9_])else\n'", "\n", $f);
491 491
 
492 492
 		$r1 = array( // keywords with a direct object
493
-			'case','delete','do','else','function','in','instanceof','of','break',
494
-			'new','return','throw','typeof','var','void','yield','let','if',
495
-			'const','get','set',
493
+			'case', 'delete', 'do', 'else', 'function', 'in', 'instanceof', 'of', 'break',
494
+			'new', 'return', 'throw', 'typeof', 'var', 'void', 'yield', 'let', 'if',
495
+			'const', 'get', 'set',
496 496
 		);
497 497
 
498 498
 		$r2 = array( // keywords with a subject
499
-			'in','instanceof','of',
499
+			'in', 'instanceof', 'of',
500 500
 		);
501 501
 
502 502
 		// Fix missing semi-colons
503
-		$f = preg_replace("'(?<!(?<![a-zA-Z0-9_\$])".implode(')(?<!(?<![a-zA-Z0-9_\$])', $r1).') (?!('.implode('|', $r2).")(?![a-zA-Z0-9_\$]))'", "\n", $f);
503
+		$f = preg_replace("'(?<!(?<![a-zA-Z0-9_\$])" . implode(')(?<!(?<![a-zA-Z0-9_\$])', $r1) . ') (?!(' . implode('|', $r2) . ")(?![a-zA-Z0-9_\$]))'", "\n", $f);
504 504
 		$f = preg_replace("'(?<!(?<![a-zA-Z0-9_\$])do)(?<!(?<![a-zA-Z0-9_\$])else) if\('", "\nif(", $f);
505
-		$f = preg_replace("'(?<=--|\+\+)(?<![a-zA-Z0-9_\$])(".implode('|', $r1).")(?![a-zA-Z0-9_\$])'", "\n$1", $f);
505
+		$f = preg_replace("'(?<=--|\+\+)(?<![a-zA-Z0-9_\$])(" . implode('|', $r1) . ")(?![a-zA-Z0-9_\$])'", "\n$1", $f);
506 506
 		$f = preg_replace("'(?<![a-zA-Z0-9_\$])for\neach\('", 'for each(', $f);
507
-		$f = preg_replace("'(?<![a-zA-Z0-9_\$])\n(".implode('|', $r2).")(?![a-zA-Z0-9_\$])'", '$1', $f);
507
+		$f = preg_replace("'(?<![a-zA-Z0-9_\$])\n(" . implode('|', $r2) . ")(?![a-zA-Z0-9_\$])'", '$1', $f);
508 508
 
509 509
 		// Merge strings
510 510
 		if ($q["'"] > $q['"']) {
511 511
 			$q = array($q[1], $q[0]);
512 512
 		}
513
-		$f = preg_replace("#//''\"\"[0-9]+'#", $q[0].'$0'.$q[0], $f);
514
-		strpos($f, $q[0].'+'.$q[0]) && $f = str_replace($q[0].'+'.$q[0], '', $f);
513
+		$f = preg_replace("#//''\"\"[0-9]+'#", $q[0] . '$0' . $q[0], $f);
514
+		strpos($f, $q[0] . '+' . $q[0]) && $f = str_replace($q[0] . '+' . $q[0], '', $f);
515 515
 		$len = count($strings);
516 516
 		foreach ($strings as $r1 => &$r2) {
517 517
 			$r2 = "/'" == substr($r1, -2)
518 518
 				? str_replace(array("\\'", '\\"'), array("'", '"'), $r2)
519
-				: str_replace('\\'.$q[1], $q[1], $r2);
519
+				: str_replace('\\' . $q[1], $q[1], $r2);
520 520
 		}
521 521
 
522 522
 		// Restore wanted spaces
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
 	protected function extractClosures($code)
529 529
 	{
530
-		$code = ';'.$code;
530
+		$code = ';' . $code;
531 531
 
532 532
 		$this->argFreq[-1] += substr_count($code, '}catch(');
533 533
 
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 
540 540
 			$f = preg_split("@}catch\(({$this->varRx})@", $code, -1, PREG_SPLIT_DELIM_CAPTURE);
541 541
 
542
-			$code = 'catch$scope$var'.mt_rand();
543
-			$this->specialVarRx = $this->specialVarRx ? '(?:'.$this->specialVarRx.'|'.preg_quote($code).')' : preg_quote($code);
542
+			$code = 'catch$scope$var' . mt_rand();
543
+			$this->specialVarRx = $this->specialVarRx ? '(?:' . $this->specialVarRx . '|' . preg_quote($code) . ')' : preg_quote($code);
544 544
 			$i = count($f) - 1;
545 545
 
546 546
 			while ($i) {
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 				}
562 562
 
563 563
 				$c = preg_quote($f[$i - 1], '#');
564
-				$f[$i - 2] .= '}catch('.preg_replace("#([.,{]?)(?<![a-zA-Z0-9_\$@]){$c}\\b#", '$1'.$code, $f[$i - 1].substr($f[$i], 0, $j)).substr($f[$i], $j);
564
+				$f[$i - 2] .= '}catch(' . preg_replace("#([.,{]?)(?<![a-zA-Z0-9_\$@]){$c}\\b#", '$1' . $code, $f[$i - 1] . substr($f[$i], 0, $j)) . substr($f[$i], $j);
565 565
 
566 566
 				unset($f[$i--], $f[$i--]);
567 567
 			}
@@ -594,8 +594,8 @@  discard block
 block discarded – undo
594 594
 
595 595
 			$l = "//''\"\"#$i'";
596 596
 			$code = substr($f[$i - 1], $c);
597
-			$closures[$l] = $code.substr($f[$i], 0, $j);
598
-			$f[$i - 2] .= substr($f[$i - 1], 0, $c).$l.substr($f[$i], $j);
597
+			$closures[$l] = $code . substr($f[$i], 0, $j);
598
+			$f[$i - 2] .= substr($f[$i - 1], 0, $c) . $l . substr($f[$i], $j);
599 599
 
600 600
 			if ('(){' !== $code) {
601 601
 				$j = substr_count($code, ',');
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 		if (preg_match("'^( [^(]*)?\((.*?)\)\{'", $closure, $v)) {
628 628
 			if ($v[1]) {
629 629
 				$vars[$tree['nfe'] = substr($v[1], 1)] = -1;
630
-				$tree['parent']['local'][';'.$key] = &$vars[$tree['nfe']];
630
+				$tree['parent']['local'][';' . $key] = &$vars[$tree['nfe']];
631 631
 			}
632 632
 
633 633
 			if ($v[2]) {
@@ -707,17 +707,17 @@  discard block
 block discarded – undo
707 707
 			foreach ($w as $k) {
708 708
 				if (isset($k[1][0]) && (',' === $k[1][0] || '{' === $k[1][0])) {
709 709
 					if (':' === $k[3]) {
710
-						$k = '.'.$k[2];
710
+						$k = '.' . $k[2];
711 711
 					} elseif ('get ' === substr($k[1], 1, 4) || 'set ' === substr($k[1], 1, 4)) {
712 712
 						++$this->charFreq[ord($k[1][1])]; // "g" or "s"
713 713
 						++$this->charFreq[101]; // "e"
714 714
 						++$this->charFreq[116]; // "t"
715
-						$k = '.'.$k[2];
715
+						$k = '.' . $k[2];
716 716
 					} else {
717 717
 						$k = $k[2];
718 718
 					}
719 719
 				} else {
720
-					$k = $k[1].$k[2];
720
+					$k = $k[1] . $k[2];
721 721
 				}
722 722
 
723 723
 				isset($vars[$k]) ? ++$vars[$k] : $vars[$k] = 1;
@@ -737,12 +737,12 @@  discard block
 block discarded – undo
737 737
 					if (1 === $i % 2) {
738 738
 						if (',' === $k[0] || '{' === $k[0]) {
739 739
 							if (':' === substr($k, -1)) {
740
-								$k = '.'.substr($k, 1, -1);
740
+								$k = '.' . substr($k, 1, -1);
741 741
 							} elseif ('get ' === substr($k, 1, 4) || 'set ' === substr($k, 1, 4)) {
742 742
 								++$this->charFreq[ord($k[1])]; // "g" or "s"
743 743
 								++$this->charFreq[101]; // "e"
744 744
 								++$this->charFreq[116]; // "t"
745
-								$k = '.'.substr($k, 5);
745
+								$k = '.' . substr($k, 5);
746 746
 							} else {
747 747
 								$k = substr($k, 1);
748 748
 							}
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 
870 870
 			if ('' === $this->str0) {
871 871
 				$this->str0 = 'claspemitdbfrugnjvhowkxqyzCLASPEMITDBFRUGNJVHOWKXQYZ';
872
-				$this->str1 = $this->str0.'0123456789';
872
+				$this->str1 = $this->str0 . '0123456789';
873 873
 			}
874 874
 
875 875
 			foreach ($tree['local'] as $var => $root) {
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 				switch (substr($var, 0, 1)) {
891 891
 					case '.':
892 892
 						if (!isset($tree['local'][substr($var, 1)])) {
893
-							$tree['local'][$var] = '#'.($this->specialVarRx && 3 < strlen($var) && preg_match("'^\.{$this->specialVarRx}$'", $var) ? $this->getNextName($tree).'$' : substr($var, 1));
893
+							$tree['local'][$var] = '#' . ($this->specialVarRx && 3 < strlen($var) && preg_match("'^\.{$this->specialVarRx}$'", $var) ? $this->getNextName($tree) . '$' : substr($var, 1));
894 894
 						}
895 895
 						break;
896 896
 
@@ -898,10 +898,10 @@  discard block
 block discarded – undo
898 898
 					case '#': break;
899 899
 
900 900
 					default:
901
-						$root = $this->specialVarRx && 2 < strlen($var) && preg_match("'^{$this->specialVarRx}$'", $var) ? $this->getNextName($tree).'$' : $var;
901
+						$root = $this->specialVarRx && 2 < strlen($var) && preg_match("'^{$this->specialVarRx}$'", $var) ? $this->getNextName($tree) . '$' : $var;
902 902
 						$tree['local'][$var] = $root;
903 903
 						if (isset($tree['local'][".{$var}"])) {
904
-							$tree['local'][".{$var}"] = '#'.$root;
904
+							$tree['local'][".{$var}"] = '#' . $root;
905 905
 						}
906 906
 				}
907 907
 			}
@@ -956,10 +956,10 @@  discard block
 block discarded – undo
956 956
 
957 957
 			if (':' === substr($m, -1)) {
958 958
 				$post = ':';
959
-				$m = (' ' !== $m[0] ? '.' : '').substr($m, 1, -1);
959
+				$m = (' ' !== $m[0] ? '.' : '') . substr($m, 1, -1);
960 960
 			} elseif ('get ' === substr($m, 1, 4) || 'set ' === substr($m, 1, 4)) {
961 961
 				$pre .= substr($m, 1, 4);
962
-				$m = '.'.substr($m, 5);
962
+				$m = '.' . substr($m, 5);
963 963
 			} else {
964 964
 				$m = substr($m, 1);
965 965
 			}
@@ -979,9 +979,9 @@  discard block
 block discarded – undo
979 979
 					: $m
980 980
 				)
981 981
 				)
982
-			).$post;
982
+			) . $post;
983 983
 
984
-		return '' === $post ? '' : ($pre.('.' === $post[0] ? substr($post, 1) : $post));
984
+		return '' === $post ? '' : ($pre . ('.' === $post[0] ? substr($post, 1) : $post));
985 985
 	}
986 986
 
987 987
 	protected function getNextName(&$tree = array(), &$counter = false)
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
 
1004 1004
 		$i = intval($counter / $len0) - 1;
1005 1005
 		while ($i >= 0) {
1006
-			$name .= $this->str1[ $i % $len1 ];
1006
+			$name .= $this->str1[$i % $len1];
1007 1007
 			$i = intval($i / $len1) - 1;
1008 1008
 		}
1009 1009
 
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 			$tuples[] = array(++$i, $k, &$v);
1033 1033
 		}
1034 1034
 
1035
-		usort($tuples, function ($a, $b) {
1035
+		usort($tuples, function($a, $b) {
1036 1036
 			if ($b[2] > $a[2]) {
1037 1037
 				return 1;
1038 1038
 			}
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.lang/classes/lang.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 	//https://paulund.co.uk/auto-detect-browser-language-in-php
30 30
 
31
-	public static function getPrefLangToken () : string {
31
+	public static function getPrefLangToken() : string {
32 32
 		if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
33 33
 			$_SERVER['HTTP_ACCEPT_LANGUAGE'] = Settings::get("default_lang");
34 34
 		}
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
 		return substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
37 37
 	}
38 38
 
39
-	public static function getLangToken (array $supported_lang_tokens) : string {
39
+	public static function getLangToken(array $supported_lang_tokens) : string {
40 40
 		//http://php.net/manual/fa/function.http-negotiate-language.php
41 41
 
42 42
 		//https://stackoverflow.com/questions/6038236/using-the-php-http-accept-language-server-variable
43 43
 
44 44
 		//https://stackoverflow.com/questions/3770513/detect-browser-language-in-php
45 45
 
46
-		return self::prefered_language($supported_lang_tokens);//http_negotiate_language($supported_lang_tokens);
46
+		return self::prefered_language($supported_lang_tokens); //http_negotiate_language($supported_lang_tokens);
47 47
 	}
48 48
 
49
-	public static function loadSupportedLangs () {
49
+	public static function loadSupportedLangs() {
50 50
 		if (Cache::contains("supported-languages", "list")) {
51 51
 			self::$supported_languages = Cache::get("supported-languages", "list");
52 52
 		} else {
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 		self::$initialized = true;
68 68
 	}
69 69
 
70
-	protected static function loadIfAbsent () {
70
+	protected static function loadIfAbsent() {
71 71
 		if (!self::$initialized) {
72 72
 			self::loadSupportedLangs();
73 73
 		}
74 74
 	}
75 75
 
76
-	public static function listSupportedLangTokens () {
76
+	public static function listSupportedLangTokens() {
77 77
 		//load tokens, if not initialized
78 78
 		self::loadIfAbsent();
79 79
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		return $keys;
98 98
 	}
99 99
 
100
-	public static function addLang (string $token, string $title) {
100
+	public static function addLang(string $token, string $title) {
101 101
 		Database::getInstance()->execute("INSERT INTO `{praefix}supported_languages` (
102 102
 			`lang_token`, `title`
103 103
 		) VALUES (
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		Cache::clear("supported-languages");
115 115
 	}
116 116
 
117
-	public static function addLangOrUpdate (string $token, string $title) {
117
+	public static function addLangOrUpdate(string $token, string $title) {
118 118
 		Database::getInstance()->execute("INSERT INTO `{praefix}supported_languages` (
119 119
 			`lang_token`, `title`
120 120
 		) VALUES (
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @return prefered language
150 150
 	 */
151
-	protected static function prefered_language (array $available_languages, string $http_accept_language = "auto") : string {
151
+	protected static function prefered_language(array $available_languages, string $http_accept_language = "auto") : string {
152 152
 		if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
153 153
 			$_SERVER['HTTP_ACCEPT_LANGUAGE'] = Settings::get("default_lang");
154 154
 		}
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
 		foreach ($hits as $arr) {
176 176
 			// read data from the array of this hit
177
-			$langprefix = strtolower ($arr[1]);
177
+			$langprefix = strtolower($arr[1]);
178 178
 			if (!empty($arr[3])) {
179
-				$langrange = strtolower ($arr[3]);
179
+				$langrange = strtolower($arr[3]);
180 180
 				$language = $langprefix . "-" . $langrange;
181 181
 			}
182 182
 			else $language = $langprefix;
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 			if (!empty($arr[5])) $qvalue = floatval($arr[5]);
185 185
 
186 186
 			// find q-maximal language
187
-			if (in_array($language,$available_languages) && ($qvalue > $bestqval)) {
187
+			if (in_array($language, $available_languages) && ($qvalue > $bestqval)) {
188 188
 				$bestlang = $language;
189 189
 				$bestqval = $qvalue;
190 190
 			}
191 191
 			// if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does)
192
-			else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) {
192
+			else if (in_array($langprefix, $available_languages) && (($qvalue * 0.9) > $bestqval)) {
193 193
 				$bestlang = $langprefix;
194
-				$bestqval = $qvalue*0.9;
194
+				$bestqval = $qvalue * 0.9;
195 195
 			}
196 196
 		}
197 197
 		return $bestlang;
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.domain/classes/domain.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		//
40 40
 	}
41 41
 
42
-	public function load ($id = null) {
42
+	public function load($id = null) {
43 43
 		if ($id == null) {
44 44
 			//get current domain
45 45
 			$id = self::getIDByDomain(DomainUtils::getCurrentDomain());
@@ -74,35 +74,35 @@  discard block
 block discarded – undo
74 74
 		));
75 75
 	}
76 76
 
77
-	public function isAlias () : bool {
77
+	public function isAlias() : bool {
78 78
 		return $this->row['alias'] != -1 && $this->row['alias'] != 0;
79 79
 	}
80 80
 
81
-	public function getDomain () : string {
81
+	public function getDomain() : string {
82 82
 		return $this->row['domain'];
83 83
 	}
84 84
 
85
-	public function getStyleID () : int {
85
+	public function getStyleID() : int {
86 86
 		return $this->row['styleID'];
87 87
 	}
88 88
 
89
-	public function getHomePage () : string {
89
+	public function getHomePage() : string {
90 90
 		return $this->row['home_page'];
91 91
 	}
92 92
 
93
-	public function isRedirectUrl () : bool {
93
+	public function isRedirectUrl() : bool {
94 94
 		return $this->row['redirect_url'] !== "none";
95 95
 	}
96 96
 
97
-	public function getRedirectUrl () : string {
97
+	public function getRedirectUrl() : string {
98 98
 		return $this->row['redirect_url'];
99 99
 	}
100 100
 
101
-	public function getRedirectCode () : int {
101
+	public function getRedirectCode() : int {
102 102
 		return $this->row['redirect_code'];
103 103
 	}
104 104
 
105
-	public static function getIDByDomain (string $domain) : int {
105
+	public static function getIDByDomain(string $domain) : int {
106 106
 		if (is_int($domain)) {
107 107
 			throw new IllegalArgumentException("domain cannot be an integer, because a domain string is requested.");
108 108
 		}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		}
142 142
 	}
143 143
 
144
-	public static function getWildcardDomainID () : int {
144
+	public static function getWildcardDomainID() : int {
145 145
 		$row = self::getWildcardDomainRow();
146 146
 
147 147
 		if (!$row) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		return $row['id'];
158 158
 	}
159 159
 
160
-	public static function getWildcardDomain () : string {
160
+	public static function getWildcardDomain() : string {
161 161
 		$row = self::getWildcardDomainRow();
162 162
 
163 163
 		if (!$row) {
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		return $row['domain'];
174 174
 	}
175 175
 
176
-	public static function getWildcardDomainRow () {
176
+	public static function getWildcardDomainRow() {
177 177
 		if (Cache::getCache()->contains("domain", "wildcard_domain_row")) {
178 178
 			return Cache::getCache()->get("domain", "wildcard_domain_row");
179 179
 		} else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		}
197 197
 	}
198 198
 
199
-	public static function createWildcardDomain () {
199
+	public static function createWildcardDomain() {
200 200
 		Database::getInstance()->execute("INSERT INTO `{praefix}domain` (
201 201
 			`id`, `domain`, `alias`, `home_page`, `wildcard`, `styleID`, `redirect_url`, `redirect_code`, `lastUpdate`, `activated`
202 202
 		) VALUES (
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		) ON DUPLICATE KEY UPDATE `activated` = '1'; ");
205 205
 	}
206 206
 
207
-	public static function getCurrent () : Domain {
207
+	public static function getCurrent() : Domain {
208 208
 		//check, if instance exists
209 209
 		if (self::$instance == null) {
210 210
 			//create new instance of domain
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.htmlpage/classes/indexpage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 		return false;
48 48
 	}
49 49
 
50
-	protected function getHTML () : string {
50
+	protected function getHTML() : string {
51 51
 		$content = $this->getPage()->getContent();
52 52
 
53 53
 		Events::throwEvent("get_content", array(
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.htmlpage/classes/error404page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class Error404Page extends HTMLPage {
29 29
 
30
-	public function setCustomHeader () {
30
+	public function setCustomHeader() {
31 31
 		//set error 404 not found header
32 32
 		header("HTTP/1.0 404 Not Found");
33 33
 	}
Please login to merge, or discard this patch.
system/packages/com.jukusoft.cms.htmlpage/classes/error403page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class Error403Page extends HTMLPage {
29 29
 
30
-	public function setCustomHeader () {
30
+	public function setCustomHeader() {
31 31
 		//set error 403 forbidden header
32 32
 		header('HTTP/1.0 403 Forbidden');
33 33
 	}
Please login to merge, or discard this patch.