@@ -111,8 +111,7 @@ discard block |
||
| 111 | 111 | if ($table instanceof Select) { |
| 112 | 112 | $this->table = $table->toSubquery(); |
| 113 | 113 | $this->alias = uniqid('_') . "_{$table->alias}"; |
| 114 | - } |
|
| 115 | - else { |
|
| 114 | + } else { |
|
| 116 | 115 | $this->table = (string)$table; |
| 117 | 116 | $this->alias = uniqid('_') . "__{$table}"; |
| 118 | 117 | } |
@@ -222,8 +221,7 @@ discard block |
||
| 222 | 221 | public function group (string $column) { |
| 223 | 222 | if (!strlen($this->_group)) { |
| 224 | 223 | $this->_group = " GROUP BY {$column}"; |
| 225 | - } |
|
| 226 | - else { |
|
| 224 | + } else { |
|
| 227 | 225 | $this->_group .= ", {$column}"; |
| 228 | 226 | } |
| 229 | 227 | return $this; |
@@ -238,8 +236,7 @@ discard block |
||
| 238 | 236 | public function having (string $condition) { |
| 239 | 237 | if (!strlen($this->_having)) { |
| 240 | 238 | $this->_having = " HAVING {$condition}"; |
| 241 | - } |
|
| 242 | - else { |
|
| 239 | + } else { |
|
| 243 | 240 | $this->_having .= " AND {$condition}"; |
| 244 | 241 | } |
| 245 | 242 | return $this; |
@@ -289,8 +286,7 @@ discard block |
||
| 289 | 286 | public function limit (int $limit, int $offset = 0) { |
| 290 | 287 | if ($limit == 0) { |
| 291 | 288 | $this->_limit = ''; |
| 292 | - } |
|
| 293 | - else { |
|
| 289 | + } else { |
|
| 294 | 290 | $this->_limit = " LIMIT {$limit}"; |
| 295 | 291 | if ($offset > 1) { |
| 296 | 292 | $this->_limit .= " OFFSET {$offset}"; |
@@ -367,8 +363,7 @@ discard block |
||
| 367 | 363 | } |
| 368 | 364 | if ($name !== $alias) { |
| 369 | 365 | $_columns[] = "{$column} AS {$alias}"; |
| 370 | - } |
|
| 371 | - else { |
|
| 366 | + } else { |
|
| 372 | 367 | $_columns[] = "{$column}"; |
| 373 | 368 | } |
| 374 | 369 | if (is_string($name)) { |
@@ -424,8 +419,7 @@ discard block |
||
| 424 | 419 | public function where (string $condition) { |
| 425 | 420 | if (!strlen($this->_where)) { |
| 426 | 421 | $this->_where = " WHERE {$condition}"; |
| 427 | - } |
|
| 428 | - else { |
|
| 422 | + } else { |
|
| 429 | 423 | $this->_where .= " AND {$condition}"; |
| 430 | 424 | } |
| 431 | 425 | return $this; |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | public static function compare ($a, $b, $oper = '=', $listOper = 'IN') { |
| 60 | 60 | if (is_array($b)) { |
| 61 | 61 | return new static("{$a} {$listOper} (" . implode(',', $b) . ")"); |
| 62 | - } |
|
| 63 | - elseif ($b instanceof Select) { |
|
| 62 | + } elseif ($b instanceof Select) { |
|
| 64 | 63 | return new static("{$a} {$listOper} ({$b->toSql()})"); |
| 65 | 64 | } |
| 66 | 65 | return new static("{$a} {$oper} {$b}"); |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | public function is ($arg): Predicate { |
| 57 | 57 | if ($arg === null or is_bool($arg)) { |
| 58 | 58 | $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg]; |
| 59 | - } |
|
| 60 | - else { |
|
| 59 | + } else { |
|
| 61 | 60 | $arg = $this->db->quote($arg); |
| 62 | 61 | } |
| 63 | 62 | switch ($this->db) { |