@@ -139,9 +139,9 @@ |
||
139 | 139 | $typeByValue = DBField::getType($value); |
140 | 140 | if ($typeByValue != 's') { |
141 | 141 | if ($type != $typeByValue && !( |
142 | - ($type == 'd' && $typeByValue == 'i') || // We can put integer as double |
|
142 | + ($type == 'd' && $typeByValue == 'i') || // We can put integer as double |
|
143 | 143 | ($type == 's' && $typeByValue == 'i') // We can put integer as string |
144 | - ) |
|
144 | + ) |
|
145 | 145 | ) { |
146 | 146 | throw new DBCoreException( |
147 | 147 | "Invalid query parameters types string ('" . $value . |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $chunks = []; |
200 | 200 | foreach (array_keys($fieldsList) as $fieldName) { |
201 | 201 | if ($fieldName != $idFieldName) { |
202 | - $chunks[]= "`" . $fieldName . "` = ?"; |
|
202 | + $chunks[] = "`" . $fieldName . "` = ?"; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | return implode(", ", $chunks); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $chunks = []; |
218 | 218 | foreach ($fieldsList as $fieldName => $fieldValue) { |
219 | 219 | if ($fieldName != $idFieldName) { |
220 | - $chunks[]= "`" . $fieldName . "` = '" . $fieldValue . "'"; |
|
220 | + $chunks[] = "`" . $fieldName . "` = '" . $fieldValue . "'"; |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | return implode(", ", $chunks); |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | foreach ($fieldsList as $fieldName => $fieldValue) { |
241 | 241 | if ($fieldName != $idFieldName) { |
242 | 242 | if (Tools::isDouble($fieldValue)) { |
243 | - $typesString.= "d"; |
|
243 | + $typesString .= "d"; |
|
244 | 244 | } elseif (Tools::isInteger($fieldValue)) { |
245 | - $typesString.= "i"; |
|
245 | + $typesString .= "i"; |
|
246 | 246 | } else { |
247 | - $typesString.= "s"; |
|
247 | + $typesString .= "s"; |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $type = DBField::castType($type); |
265 | 265 | $typesString = ""; |
266 | 266 | while ($length > 0) { |
267 | - $typesString.= $type; |
|
267 | + $typesString .= $type; |
|
268 | 268 | $length--; |
269 | 269 | } |
270 | 270 | |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | foreach ($values as $fieldName => $fieldValue) { |
284 | 284 | if (!is_array($fieldValue)) { |
285 | 285 | if (!is_null($fieldValue)) { |
286 | - $chunks[]= $fieldName . " = ?"; |
|
287 | - $this->types.= DBField::getType($fieldValue); |
|
286 | + $chunks[] = $fieldName . " = ?"; |
|
287 | + $this->types .= DBField::getType($fieldValue); |
|
288 | 288 | $this->params[] = $fieldValue; |
289 | 289 | } else { |
290 | - $chunks[]= $fieldName; |
|
290 | + $chunks[] = $fieldName; |
|
291 | 291 | } |
292 | 292 | } else { |
293 | 293 | $condition = $fieldName; |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | |
296 | 296 | $chunks[] = $condition; |
297 | 297 | foreach ($localParams as $param) { |
298 | - $this->types.= DBField::getType($param); |
|
298 | + $this->types .= DBField::getType($param); |
|
299 | 299 | $this->params[] = $param; |
300 | 300 | } |
301 | 301 | } |
302 | 302 | } |
303 | - $this->query.= implode($separator, $chunks); |
|
303 | + $this->query .= implode($separator, $chunks); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | } |
@@ -149,7 +149,7 @@ |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | $array = &$array[$key]; |
152 | - } elseif(isset($array[$key])) { // last element |
|
152 | + } elseif (isset($array[$key])) { // last element |
|
153 | 153 | unset($array[$key]); |
154 | 154 | } |
155 | 155 | } |
@@ -89,11 +89,11 @@ |
||
89 | 89 | */ |
90 | 90 | protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = "") { |
91 | 91 | $headers = "From: " . $this->fromName . " <" . $this->fromEmail . ">\r\n"; |
92 | - $headers.= "Reply-To: " . $replyTo . "\r\n"; |
|
92 | + $headers .= "Reply-To: " . $replyTo . "\r\n"; |
|
93 | 93 | |
94 | 94 | if ($format == self::FORMAT_HTML) { |
95 | - $headers.= "MIME-Version: 1.0\r\n"; |
|
96 | - $headers.= "Content-type: text/html; charset=utf-8\r\n"; |
|
95 | + $headers .= "MIME-Version: 1.0\r\n"; |
|
96 | + $headers .= "Content-type: text/html; charset=utf-8\r\n"; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -309,7 +309,7 @@ |
||
309 | 309 | */ |
310 | 310 | public static function validateDouble($fieldName) { |
311 | 311 | $fieldValue = trim(Request::getFieldValue($fieldName)); |
312 | - $doubleValue = (double) $fieldValue; |
|
312 | + $doubleValue = (double)$fieldValue; |
|
313 | 313 | if (!validateNotEmpty($fieldName)) { |
314 | 314 | Errors::saveErrorFor($fieldName, \__ERRORS::FIELD_CANT_BE_EMPTY); |
315 | 315 | return false; |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | public function getUrl($action, $id = null, $getParams = array()) { |
99 | 99 | $url = $this->controller . "/"; |
100 | 100 | if (!is_null($id)) { |
101 | - $url.= $action . "/" . $id; |
|
101 | + $url .= $action . "/" . $id; |
|
102 | 102 | } else { |
103 | - $url.= $action; |
|
103 | + $url .= $action; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if (!empty($getParams)) { |
107 | - $url.= "?"; |
|
107 | + $url .= "?"; |
|
108 | 108 | foreach ($getParams as $key => $value) { |
109 | - $url.= $key . "=" . $value; |
|
109 | + $url .= $key . "=" . $value; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | return $url; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | public function tplPath() { |
121 | 121 | $path = $this->controller . "/" . $this->controller; |
122 | 122 | if (!empty($this->action)) { |
123 | - $path.= "_" . $this->action; |
|
123 | + $path .= "_" . $this->action; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $path; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public static function getFilterValue($filterName, $defaultValue = null) { |
37 | 37 | global $_FILTER; |
38 | 38 | |
39 | - return isset($_FILTER[$filterName])?$_FILTER[$filterName]:$defaultValue; |
|
39 | + return isset($_FILTER[$filterName]) ? $_FILTER[$filterName] : $defaultValue; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } else { |
47 | 47 | $fieldValue = $newValue; |
48 | 48 | } |
49 | - $count ++; |
|
49 | + $count++; |
|
50 | 50 | } elseif (!empty($this->fieldsAliases)) { // look up for the field aliases |
51 | 51 | $fieldAliases = array_keys($this->fieldsAliases, $fieldName); |
52 | 52 | if (!empty($fieldAliases)) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } else { |
59 | 59 | $fieldValue = $newValue; |
60 | 60 | } |
61 | - $count ++; |
|
61 | + $count++; |
|
62 | 62 | |
63 | 63 | break; |
64 | 64 | } |
@@ -13,10 +13,10 @@ |
||
13 | 13 | |
14 | 14 | $deepness = substr_count($_SERVER['SCRIPT_NAME'], "/") - 1; |
15 | 15 | |
16 | -$_PATH = $deepness>0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
16 | +$_PATH = $deepness > 0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
17 | 17 | |
18 | 18 | require_once($_PATH . "vendor/autoload.php"); |
19 | -spl_autoload_register(function ($className) { |
|
19 | +spl_autoload_register(function($className) { |
|
20 | 20 | global $_PATH; |
21 | 21 | |
22 | 22 | $path = explode("\\", $className); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if ($type === 0) { |
38 | 38 | $errorTypes[] = "E_LOG_INFO"; |
39 | 39 | } else { |
40 | - for ($i = 0; $i < 15; $i++) { |
|
40 | + for ($i = 0; $i < 15; $i++) { |
|
41 | 41 | $errorType = self::friendlyErrorType($type & pow(2, $i)); |
42 | 42 | if (!empty($errorType)) { |
43 | 43 | $errorTypes[] = $errorType; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | private static function friendlyErrorType($type) { |
60 | - switch($type) { |
|
60 | + switch ($type) { |
|
61 | 61 | case E_ERROR: // 1 |
62 | 62 | return 'E_ERROR'; |
63 | 63 | case E_WARNING: // 2 |