@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = '') |
94 | 94 | { |
95 | - $headers = 'From: '.$this->fromName.' <'.$this->fromEmail.">\r\n"; |
|
96 | - $headers .= 'Reply-To: '.$replyTo."\r\n"; |
|
95 | + $headers = 'From: ' . $this->fromName . ' <' . $this->fromEmail . ">\r\n"; |
|
96 | + $headers .= 'Reply-To: ' . $replyTo . "\r\n"; |
|
97 | 97 | |
98 | 98 | if ($format == self::FORMAT_HTML) { |
99 | 99 | $headers .= "MIME-Version: 1.0\r\n"; |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | $_EMAIL = $params; |
155 | 155 | |
156 | 156 | ob_start(); |
157 | - include $this->tplFolder.$languageCode.'/'.$template.'.tpl.php'; |
|
157 | + include $this->tplFolder . $languageCode . '/' . $template . '.tpl.php'; |
|
158 | 158 | if (!empty($this->signatureTpl)) { |
159 | - include $this->tplFolder.$languageCode.'/'.$this->signatureTpl; |
|
159 | + include $this->tplFolder . $languageCode . '/' . $this->signatureTpl; |
|
160 | 160 | } |
161 | 161 | $message = ob_get_contents(); |
162 | 162 | ob_end_clean(); |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | fgets($sock, 1024); |
63 | 63 | |
64 | 64 | // Connection accepted |
65 | - fwrite($sock, 'USER '.$username."\r\n"); |
|
65 | + fwrite($sock, 'USER ' . $username . "\r\n"); |
|
66 | 66 | $userresponse = fgets($sock, 1024); |
67 | 67 | if ($userresponse[0] == '+') { // User accepted |
68 | - fwrite($sock, 'PASS '.$password."\r\n"); |
|
68 | + fwrite($sock, 'PASS ' . $password . "\r\n"); |
|
69 | 69 | $passresponse = fgets($sock, 1024); |
70 | 70 | if ($passresponse[0] != '+') { // Wrong password |
71 | 71 | $passresponse = str_replace("\r", '', str_replace("\n", '', $passresponse)); |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | } |
77 | 77 | } else { // Invalid username |
78 | 78 | throw new POPServerException( |
79 | - "Username '".$username."' not accepted.", 1 |
|
79 | + "Username '" . $username . "' not accepted.", 1 |
|
80 | 80 | ); |
81 | 81 | } |
82 | 82 | } else { |
83 | 83 | throw new POPServerException( |
84 | - 'Unable to Connect to '.$host.'. Network Problems could be responsible.', 2 |
|
84 | + 'Unable to Connect to ' . $host . '. Network Problems could be responsible.', 2 |
|
85 | 85 | ); |
86 | 86 | } |
87 | 87 | $this->connection = $sock; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $statresponse = fgets($this->connection, 1024); |
126 | 126 | $avar = explode(' ', $statresponse); |
127 | 127 | |
128 | - return (int) $avar[1]; |
|
128 | + return (int)$avar[1]; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -373,8 +373,8 @@ discard block |
||
373 | 373 | $ret = $L2 = $L3 = null; |
374 | 374 | for ($i = 0; $i < $len; $i++) { |
375 | 375 | if (isset($avar[$i]) && isset($avar[$i][0]) && isset($avar[$i][1]) && isset($avar[$i][2])) { |
376 | - $L2 = $avar[$i][0].$avar[$i][1]; |
|
377 | - $L3 = $avar[$i][0].$avar[$i][1].$avar[$i][2]; |
|
376 | + $L2 = $avar[$i][0] . $avar[$i][1]; |
|
377 | + $L3 = $avar[$i][0] . $avar[$i][1] . $avar[$i][2]; |
|
378 | 378 | if ($L2 != ' ' && $L3 != 'Rec' && $L2 != '') { |
379 | 379 | $avar2 = explode(':', $avar[$i]); |
380 | 380 | $temp = str_replace("$avar2[0]:", '', $avar[$i]); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | return $this; |
99 | 99 | } else { |
100 | - throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
100 | + throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if (isset($this->fieldsList[$fieldName])) { |
142 | 142 | return $this->fieldsList[$fieldName]; |
143 | 143 | } else { |
144 | - throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
144 | + throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function __set($fieldName, $fieldValue) |
228 | 228 | { |
229 | - return call_user_func_array([$this, 'set'.ucfirst($fieldName)], [$fieldValue]); |
|
229 | + return call_user_func_array([$this, 'set' . ucfirst($fieldName)], [$fieldValue]); |
|
230 | 230 | //return $this->setFieldValue($this->getFieldName($fieldName), $fieldValue); |
231 | 231 | } |
232 | 232 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public function __get($fieldName) |
241 | 241 | { |
242 | - return call_user_func_array([$this, 'get'.ucfirst($fieldName)], []); |
|
242 | + return call_user_func_array([$this, 'get' . ucfirst($fieldName)], []); |
|
243 | 243 | //return $this->getFieldValue($this->getFieldName($fieldName)); |
244 | 244 | } |
245 | 245 | } |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function getUrl($action, $id = null, $getParams = []) |
104 | 104 | { |
105 | - $url = $this->controller.'/'; |
|
105 | + $url = $this->controller . '/'; |
|
106 | 106 | if (!is_null($id)) { |
107 | - $url .= $action.'/'.$id; |
|
107 | + $url .= $action . '/' . $id; |
|
108 | 108 | } else { |
109 | 109 | $url .= $action; |
110 | 110 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (!empty($getParams)) { |
113 | 113 | $url .= '?'; |
114 | 114 | foreach ($getParams as $key => $value) { |
115 | - $url .= $key.'='.$value; |
|
115 | + $url .= $key . '=' . $value; |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function tplPath() |
128 | 128 | { |
129 | - $path = $this->controller.'/'.$this->controller; |
|
129 | + $path = $this->controller . '/' . $this->controller; |
|
130 | 130 | if (!empty($this->action)) { |
131 | - $path .= '_'.$this->action; |
|
131 | + $path .= '_' . $this->action; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | return $path; |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | return ''; |
231 | 231 | } |
232 | 232 | |
233 | - if (!self::validateRegexp($url, '#^'.$protocol.'://.+#')) { |
|
234 | - $url = $protocol.'://'.$url; |
|
233 | + if (!self::validateRegexp($url, '#^' . $protocol . '://.+#')) { |
|
234 | + $url = $protocol . '://' . $url; |
|
235 | 235 | } |
236 | 236 | $url = preg_replace('#/{3,}#', '//', $url); |
237 | 237 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | public static function validateDouble($fieldName) |
361 | 361 | { |
362 | 362 | $fieldValue = trim(Request::getFieldValue($fieldName)); |
363 | - $doubleValue = (float) $fieldValue; |
|
363 | + $doubleValue = (float)$fieldValue; |
|
364 | 364 | if (!validateNotEmpty($fieldName)) { |
365 | 365 | Errors::saveErrorFor($fieldName, \__ERRORS::FIELD_CANT_BE_EMPTY); |
366 | 366 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public static function line($str = '') |
61 | 61 | { |
62 | - self::output($str."\n"); |
|
62 | + self::output($str . "\n"); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $str = str_replace('{{time}}', date($format, $time), $str); |
82 | 82 | self::line($str); |
83 | 83 | } else { |
84 | - self::line(date($format, $time).' '.$str); |
|
84 | + self::line(date($format, $time) . ' ' . $str); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | public static function message($msgType, $str, $format = "\[Y-m-d H:i:s\]", $time = null) |
99 | 99 | { |
100 | 100 | if (strpos($str, '{{time}}') === false) { |
101 | - $str = '{{time}} '.$str; |
|
101 | + $str = '{{time}} ' . $str; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | self::log( |
105 | - '<b><font color="'.$msgType.'">'.$str.'</font></b>', |
|
105 | + '<b><font color="' . $msgType . '">' . $str . '</font></b>', |
|
106 | 106 | $format, |
107 | 107 | $time |
108 | 108 | ); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public static function isDoubleString($input) |
90 | 90 | { |
91 | - $doubleValue = (float) $input; |
|
92 | - $stringValue = str_replace(',', '.', (string) $input); |
|
91 | + $doubleValue = (float)$input; |
|
92 | + $stringValue = str_replace(',', '.', (string)$input); |
|
93 | 93 | |
94 | 94 | if (is_numeric($stringValue)) { |
95 | 95 | return true; |
96 | 96 | } |
97 | 97 | |
98 | - if ($stringValue === (string) $doubleValue) { |
|
98 | + if ($stringValue === (string)$doubleValue) { |
|
99 | 99 | return true; |
100 | 100 | } |
101 | 101 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function toDouble($value) |
113 | 113 | { |
114 | - return (float) str_replace(',', '.', (string) $value); |
|
114 | + return (float)str_replace(',', '.', (string)$value); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | if ($encoding) { |
33 | 33 | $firstLetter = mb_substr(mb_strtoupper($str, $encoding), 0, 1, $encoding); |
34 | 34 | |
35 | - return $firstLetter.mb_substr($str, 1, null, $encoding); |
|
35 | + return $firstLetter . mb_substr($str, 1, null, $encoding); |
|
36 | 36 | } else { |
37 | 37 | $firstLetter = mb_substr(mb_strtoupper($str), 0, 1); |
38 | 38 | |
39 | - return $firstLetter.mb_substr($str, 1); |
|
39 | + return $firstLetter . mb_substr($str, 1); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | if ($encoding) { |
57 | 57 | $firstLetter = mb_substr(mb_strtoupper($str, $encoding), 0, 1, $encoding); |
58 | 58 | |
59 | - return $firstLetter.mb_substr($str, 1, null, $encoding); |
|
59 | + return $firstLetter . mb_substr($str, 1, null, $encoding); |
|
60 | 60 | } else { |
61 | 61 | $firstLetter = mb_substr(mb_strtoupper($str), 0, 1); |
62 | 62 | |
63 | - return $firstLetter.mb_substr($str, 1); |
|
63 | + return $firstLetter . mb_substr($str, 1); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | */ |
133 | 133 | public static function reorderMessages() |
134 | 134 | { |
135 | - uasort(self::$messages, function ($a, $b) { |
|
135 | + uasort(self::$messages, function($a, $b) { |
|
136 | 136 | return $a->type <= $b->type; |
137 | 137 | }); |
138 | 138 | } |