@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | break; |
107 | 107 | case ("IN"): |
108 | 108 | case ("NOT IN"): |
109 | - if (is_array($value) && !empty($value)) { |
|
109 | + if (is_array($value) && !empty($value)) { |
|
110 | 110 | $dataList = []; |
111 | 111 | foreach ($value as $dataItem) { |
112 | 112 | $dataList[] = DBField::sqlValue($this->field->type, $dataItem); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | if ($count > 0) { |
117 | 117 | $qmStr = "?"; |
118 | 118 | $tStr = $this->field->type; |
119 | - for ($i = 1; $i < $count; $i ++) { |
|
119 | + for ($i = 1; $i < $count; $i++) { |
|
120 | 120 | $qmStr .= ", ?"; |
121 | 121 | $tStr .= $this->field->type; |
122 | 122 | } |
@@ -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 | /** |
@@ -103,7 +103,7 @@ |
||
103 | 103 | public static function getErrors() { |
104 | 104 | global $_ERRORS; |
105 | 105 | |
106 | - return (isset($_ERRORS['_common'])?$_ERRORS['_common']:array()); |
|
106 | + return (isset($_ERRORS['_common']) ? $_ERRORS['_common'] : array()); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -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 | } |