@@ -277,7 +277,7 @@ |
||
| 277 | 277 | public function __call($method, array $arguments) |
| 278 | 278 | { |
| 279 | 279 | if (!in_array($method = strtoupper($method), ['AVG', 'MIN', 'MAX', 'SUM'])) { |
| 280 | - throw new BuilderException("Unknown method '{$method}' in '" . get_class($this) . "'"); |
|
| 280 | + throw new BuilderException("Unknown method '{$method}' in '".get_class($this)."'"); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | if (!isset($arguments[0]) || count($arguments) > 1) { |
@@ -226,7 +226,7 @@ |
||
| 226 | 226 | */ |
| 227 | 227 | private function havingWrapper() |
| 228 | 228 | { |
| 229 | - return function ($parameter) { |
|
| 229 | + return function($parameter) { |
|
| 230 | 230 | if ($parameter instanceof FragmentInterface) { |
| 231 | 231 | |
| 232 | 232 | //We are only not creating bindings for plan fragments |
@@ -115,14 +115,14 @@ discard block |
||
| 115 | 115 | public function getPrimary(string $prefix, string $table) |
| 116 | 116 | { |
| 117 | 117 | if (!empty($this->memory) && empty($this->primaryKeys)) { |
| 118 | - $this->primaryKeys = (array)$this->memory->loadData($this->getSource() . '.keys'); |
|
| 118 | + $this->primaryKeys = (array)$this->memory->loadData($this->getSource().'.keys'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | if (!empty($this->primaryKeys) && array_key_exists($table, $this->primaryKeys)) { |
| 122 | 122 | return $this->primaryKeys[$table]; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if (!$this->hasTable($prefix . $table)) { |
|
| 125 | + if (!$this->hasTable($prefix.$table)) { |
|
| 126 | 126 | throw new DriverException( |
| 127 | 127 | "Unable to fetch table primary key, no such table '{$prefix}{$table}' exists" |
| 128 | 128 | ); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | //Caching |
| 140 | 140 | if (!empty($this->memory)) { |
| 141 | - $this->memory->saveData($this->getSource() . '.keys', $this->primaryKeys); |
|
| 141 | + $this->memory->saveData($this->getSource().'.keys', $this->primaryKeys); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | return $this->primaryKeys[$table]; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | return $this->container->make( |
| 155 | 155 | PostgresInsertQuery::class, |
| 156 | - ['driver' => $this, 'compiler' => $this->queryCompiler($prefix),] + $parameters |
|
| 156 | + ['driver' => $this, 'compiler' => $this->queryCompiler($prefix), ] + $parameters |
|
| 157 | 157 | ); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | $quoted = $driver->identifier($this->name); |
| 145 | 145 | |
| 146 | - return "$statement CHECK ({$quoted} IN (" . implode(', ', $enumValues) . '))'; |
|
| 146 | + return "$statement CHECK ({$quoted} IN (".implode(', ', $enumValues).'))'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | $selectColumns[] = "? AS {$this->quote($column)}"; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $statement[] = 'SELECT ' . implode(', ', $selectColumns); |
|
| 41 | + $statement[] = 'SELECT '.implode(', ', $selectColumns); |
|
| 42 | 42 | } else { |
| 43 | 43 | //It is crityially important to use UNION ALL, UNION will try to merge values together |
| 44 | 44 | //which will cause non predictable insert order |
| 45 | - $statement[] = 'UNION ALL SELECT ' . trim(str_repeat('?, ', count($columns)), ', '); |
|
| 45 | + $statement[] = 'UNION ALL SELECT '.trim(str_repeat('?, ', count($columns)), ', '); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $statement = ''; |
| 64 | 64 | |
| 65 | 65 | if (!empty($limit) || !empty($offset)) { |
| 66 | - $statement = 'LIMIT ' . ($limit ?: '-1') . ' '; |
|
| 66 | + $statement = 'LIMIT '.($limit ?: '-1').' '; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (!empty($offset)) { |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | { |
| 168 | 168 | //Temporary table is required to copy data over |
| 169 | 169 | $temporary = clone $table; |
| 170 | - $temporary->setName('spiral_temp_' . $table->getName() . '_' . uniqid()); |
|
| 170 | + $temporary->setName('spiral_temp_'.$table->getName().'_'.uniqid()); |
|
| 171 | 171 | |
| 172 | 172 | //We don't need any indexes in temporary table |
| 173 | 173 | foreach ($temporary->getIndexes() as $index) { |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | |
| 201 | 201 | //Fetching enum values |
| 202 | 202 | if ($column->abstractType() == 'enum' && !empty($options)) { |
| 203 | - $column->enumValues = array_map(function ($value) { |
|
| 203 | + $column->enumValues = array_map(function($value) { |
|
| 204 | 204 | return trim($value, $value[0]); |
| 205 | 205 | }, $options); |
| 206 | 206 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if (!empty($limit) || !empty($offset)) { |
| 32 | 32 | //When limit is not provided (or 0) but offset does we can replace |
| 33 | 33 | //limit value with PHP_INT_MAX |
| 34 | - $statement = 'LIMIT ' . ($limit ?: '18446744073709551615') . ' '; |
|
| 34 | + $statement = 'LIMIT '.($limit ?: '18446744073709551615').' '; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (!empty($offset)) { |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function identifier(string $identifier): string |
| 52 | 52 | { |
| 53 | - return $identifier == '*' ? '*' : '`' . str_replace('`', '``', $identifier) . '`'; |
|
| 53 | + return $identifier == '*' ? '*' : '`'.str_replace('`', '``', $identifier).'`'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |