@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function compileInsert($table, array $columns, array $rowsets, $primaryKey = '') |
21 | 21 | { |
22 | - return parent::compileInsert($table, $columns, $rowsets) . (!empty($primaryKey) |
|
23 | - ? ' RETURNING ' . $this->quote($primaryKey) |
|
22 | + return parent::compileInsert($table, $columns, $rowsets).(!empty($primaryKey) |
|
23 | + ? ' RETURNING '.$this->quote($primaryKey) |
|
24 | 24 | : '' |
25 | 25 | ); |
26 | 26 | } |
@@ -34,6 +34,6 @@ discard block |
||
34 | 34 | return ''; |
35 | 35 | } |
36 | 36 | |
37 | - return "DISTINCT" . (is_string($distinct) ? '(' . $this->quote($distinct) . ')' : ''); |
|
37 | + return "DISTINCT".(is_string($distinct) ? '('.$this->quote($distinct).')' : ''); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | \ No newline at end of file |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | public function getPrimary($table) |
118 | 118 | { |
119 | 119 | if (!empty($this->memory) && empty($this->primaryKeys)) { |
120 | - $this->primaryKeys = (array)$this->memory->loadData($this->getSource() . '-primary'); |
|
120 | + $this->primaryKeys = (array)$this->memory->loadData($this->getSource().'-primary'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | if (!empty($this->primaryKeys) && array_key_exists($table, $this->primaryKeys)) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | //Caching |
142 | 142 | if (!empty($this->memory)) { |
143 | - $this->memory->saveData($this->getSource() . '-primary', $this->primaryKeys); |
|
143 | + $this->memory->saveData($this->getSource().'-primary', $this->primaryKeys); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $this->primaryKeys[$table]; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | ); |
38 | 38 | } |
39 | 39 | |
40 | - if ($primary = $driver->getPrimary($this->database->getPrefix() . $this->table)) { |
|
40 | + if ($primary = $driver->getPrimary($this->database->getPrefix().$this->table)) { |
|
41 | 41 | $this->logger()->debug( |
42 | 42 | "Primary key '{sequence}' automatically resolved for table '{table}'.", |
43 | 43 | [ |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | return "$statement CONSTRAINT {$this->enumConstraint(true, true)} " |
198 | - . "CHECK ({$this->getName(true)} IN (" . join(', ', $enumValues) . "))"; |
|
198 | + . "CHECK ({$this->getName(true)} IN (".join(', ', $enumValues)."))"; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | if ($original->abstractType() == 'enum' && !empty($this->enumConstraint)) { |
240 | - $operations[] = 'DROP CONSTRAINT ' . $this->enumConstraint(true); |
|
240 | + $operations[] = 'DROP CONSTRAINT '.$this->enumConstraint(true); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | if ($original->defaultValue != $this->defaultValue) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | if ($original->nullable != $this->nullable) { |
252 | 252 | $operations[] = "ALTER COLUMN {$this->getName(true)} " |
253 | - . (!$this->nullable ? 'SET' : 'DROP') . " NOT NULL"; |
|
253 | + . (!$this->nullable ? 'SET' : 'DROP')." NOT NULL"; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | if ($this->abstractType() == 'enum') { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | $operations[] = "ADD CONSTRAINT {$this->enumConstraint(true)} " |
263 | - . "CHECK ({$this->getName(true)} IN (" . join(', ', $enumValues) . "))"; |
|
263 | + . "CHECK ({$this->getName(true)} IN (".join(', ', $enumValues)."))"; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | return $operations; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | protected function prepareEnum() |
326 | 326 | { |
327 | - return '(' . $this->size . ')'; |
|
327 | + return '('.$this->size.')'; |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | { |
340 | 340 | if (empty($this->enumConstraint)) { |
341 | 341 | if ($temporary) { |
342 | - return $this->table->getName() . '_' . $this->getName() . '_enum'; |
|
342 | + return $this->table->getName().'_'.$this->getName().'_enum'; |
|
343 | 343 | } |
344 | 344 | |
345 | - $this->enumConstraint = $this->table->getName() . '_' . $this->getName() . '_enum_' . uniqid(); |
|
345 | + $this->enumConstraint = $this->table->getName().'_'.$this->getName().'_enum_'.uniqid(); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | return $quote ? $this->table->driver()->identifier($this->enumConstraint) : $this->enumConstraint; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | private function resolveNativeEnum() |
374 | 374 | { |
375 | 375 | $range = $this->table->driver()->query( |
376 | - 'SELECT enum_range(NULL::' . $this->type . ')' |
|
376 | + 'SELECT enum_range(NULL::'.$this->type.')' |
|
377 | 377 | )->fetchColumn(0); |
378 | 378 | |
379 | 379 | $this->enumValues = explode(',', substr($range, 1, -1)); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | . "WHERE conrelid = ? AND contype = 'c' AND (consrc LIKE ? OR consrc LIKE ?)"; |
400 | 400 | |
401 | 401 | $constraints = $this->table->driver()->query( |
402 | - $query, [$tableOID, '(' . $this->name . '%', '("' . $this->name . '%',] |
|
402 | + $query, [$tableOID, '('.$this->name.'%', '("'.$this->name.'%', ] |
|
403 | 403 | ); |
404 | 404 | |
405 | 405 | foreach ($constraints as $constraint) { |
@@ -137,7 +137,7 @@ |
||
137 | 137 | $offset = $offset + 1; |
138 | 138 | |
139 | 139 | if (!empty($limit)) { |
140 | - $statement .= "BETWEEN {$offset} AND " . ($offset + $limit - 1); |
|
140 | + $statement .= "BETWEEN {$offset} AND ".($offset + $limit - 1); |
|
141 | 141 | } else { |
142 | 142 | $statement .= ">= {$offset}"; |
143 | 143 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | */ |
85 | 85 | public function identifier($identifier) |
86 | 86 | { |
87 | - return $identifier == '*' ? '*' : '[' . str_replace('[', '[[', $identifier) . ']'; |
|
87 | + return $identifier == '*' ? '*' : '['.str_replace('[', '[[', $identifier).']'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | $type = "ALTER COLUMN {$this->getName(true)} varchar($enumSize)"; |
236 | - $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL'); |
|
236 | + $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL'); |
|
237 | 237 | } else { |
238 | 238 | $type = "ALTER COLUMN {$this->getName(true)} {$this->type}"; |
239 | 239 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $type .= "($this->precision, $this->scale)"; |
246 | 246 | } |
247 | 247 | |
248 | - $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL'); |
|
248 | + $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL'); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | //We made some assumptions here... |
431 | 431 | if (preg_match_all( |
432 | - '/' . $name . '=[\']?([^\']+)[\']?/i', |
|
432 | + '/'.$name.'=[\']?([^\']+)[\']?/i', |
|
433 | 433 | $checkConstraint['definition'], |
434 | 434 | $matches |
435 | 435 | )) { |
@@ -448,6 +448,6 @@ discard block |
||
448 | 448 | */ |
449 | 449 | private function generateName($type) |
450 | 450 | { |
451 | - return $this->table->getName() . '_' . $this->getName() . "_{$type}_" . uniqid(); |
|
451 | + return $this->table->getName().'_'.$this->getName()."_{$type}_".uniqid(); |
|
452 | 452 | } |
453 | 453 | } |
454 | 454 | \ No newline at end of file |
@@ -66,7 +66,7 @@ |
||
66 | 66 | if ($column->getName() != $initial->getName()) { |
67 | 67 | //Renaming is separate operation |
68 | 68 | $this->run("sp_rename ?, ?, 'COLUMN'", [ |
69 | - $table->getName() . '.' . $initial->getName(), |
|
69 | + $table->getName().'.'.$initial->getName(), |
|
70 | 70 | $column->getName() |
71 | 71 | ]); |
72 | 72 | } |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $selectColumns[] = "? AS {$this->quote($column)}"; |
35 | 35 | } |
36 | 36 | |
37 | - $statement[] = 'SELECT ' . join(', ', $selectColumns); |
|
37 | + $statement[] = 'SELECT '.join(', ', $selectColumns); |
|
38 | 38 | } else { |
39 | - $statement[] = 'UNION SELECT ' . trim(str_repeat('?, ', count($columns)), ', '); |
|
39 | + $statement[] = 'UNION SELECT '.trim(str_repeat('?, ', count($columns)), ', '); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $statement = ''; |
58 | 58 | |
59 | 59 | if (!empty($limit) || !empty($offset)) { |
60 | - $statement = "LIMIT " . ($limit ?: '-1') . " "; |
|
60 | + $statement = "LIMIT ".($limit ?: '-1')." "; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (!empty($offset)) { |