@@ -397,7 +397,7 @@ |
||
| 397 | 397 | /** |
| 398 | 398 | * @param $string |
| 399 | 399 | * |
| 400 | - * @return mixed|string |
|
| 400 | + * @return string |
|
| 401 | 401 | */ |
| 402 | 402 | protected function stringEscape($string) { |
| 403 | 403 | return |
@@ -251,9 +251,9 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | protected function compileFrom() { |
| 254 | - $this->_compiledQuery[] = 'FROM `{{' . $this->stringEscape($this->table) . '}}`'; |
|
| 254 | + $this->_compiledQuery[] = 'FROM `{{'.$this->stringEscape($this->table).'}}`'; |
|
| 255 | 255 | if (!empty($this->alias)) { |
| 256 | - $this->_compiledQuery[] = 'AS `' . $this->stringEscape($this->alias) . '`'; |
|
| 256 | + $this->_compiledQuery[] = 'AS `'.$this->stringEscape($this->alias).'`'; |
|
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
@@ -262,28 +262,28 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | protected function compileWhere() { |
| 264 | 264 | // TODO - fields should be escaped !! |
| 265 | - !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false; |
|
| 265 | + !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | protected function compileGroupBy() { |
| 269 | 269 | // TODO - fields should be escaped !! |
| 270 | - !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false; |
|
| 270 | + !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.implode(',', $this->arrayEscape($this->groupBy)) : false; |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | protected function compileOrderBy() { |
| 274 | 274 | // TODO - fields should be escaped !! |
| 275 | - !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
| 275 | + !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | protected function compileHaving() { |
| 279 | 279 | // TODO - fields should be escaped !! |
| 280 | - !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false; |
|
| 280 | + !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | protected function compileLimit() { |
| 284 | 284 | // TODO - fields should be escaped !! |
| 285 | - if($limit = $this->fetchOne ? 1 : $this->limit) { |
|
| 286 | - $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : ''); |
|
| 285 | + if ($limit = $this->fetchOne ? 1 : $this->limit) { |
|
| 286 | + $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : ''); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | * @return string |
| 358 | 358 | */ |
| 359 | 359 | protected function processFieldString($fieldName) { |
| 360 | - $result = (string)$fieldName; |
|
| 360 | + $result = (string) $fieldName; |
|
| 361 | 361 | if ( |
| 362 | 362 | $result != '' |
| 363 | 363 | && |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | !($fieldName instanceof DbSqlLiteral) |
| 366 | 366 | ) { |
| 367 | 367 | // Other should be formatted |
| 368 | - $result = '`' . $this->stringEscape($result) . '`'; |
|
| 368 | + $result = '`'.$this->stringEscape($result).'`'; |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | return $result; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | protected function processField($fieldName) { |
| 380 | 380 | if (is_bool($fieldName)) { |
| 381 | - $result = (string)intval($fieldName); |
|
| 381 | + $result = (string) intval($fieldName); |
|
| 382 | 382 | } elseif (is_numeric($fieldName)) { |
| 383 | 383 | $result = $fieldName; |
| 384 | 384 | } elseif (is_null($fieldName)) { |