@@ -130,7 +130,7 @@ |
||
| 130 | 130 | |
| 131 | 131 | $quoted = $driver->getPDO()->quote($this->name); |
| 132 | 132 | |
| 133 | - return "$statement CHECK ({$quoted} IN (" . implode(', ', $enumValues) . '))'; |
|
| 133 | + return "$statement CHECK ({$quoted} IN (".implode(', ', $enumValues).'))'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | { |
| 140 | 140 | //Temporary table is required to copy data over |
| 141 | 141 | $temporary = clone $table; |
| 142 | - $temporary->setName('spiral_temp_' . $table->getName() . '_' . uniqid()); |
|
| 142 | + $temporary->setName('spiral_temp_'.$table->getName().'_'.uniqid()); |
|
| 143 | 143 | |
| 144 | 144 | //We don't need any index in temporary table |
| 145 | 145 | foreach ($temporary->getIndexes() as $index) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | //Dropping enum constrain before any operation |
| 259 | 259 | if ($initial->abstractType() == 'enum' && $this->constrained) { |
| 260 | - $operations[] = 'DROP CONSTRAINT ' . $driver->identifier($this->enumConstraint()); |
|
| 260 | + $operations[] = 'DROP CONSTRAINT '.$driver->identifier($this->enumConstraint()); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | //Default value set and dropping |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | //Nullable option |
| 273 | 273 | if ($initial->nullable != $this->nullable) { |
| 274 | - $operations[] = "ALTER COLUMN {$identifier} " . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL'; |
|
| 274 | + $operations[] = "ALTER COLUMN {$identifier} ".(!$this->nullable ? 'SET' : 'DROP').' NOT NULL'; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | if ($this->abstractType() == 'enum') { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $operations[] = "ADD CONSTRAINT {$driver->identifier($this->enumConstraint())} " |
| 284 | - . "CHECK ({$identifier} IN (" . implode(', ', $enumValues) . '))'; |
|
| 284 | + . "CHECK ({$identifier} IN (".implode(', ', $enumValues).'))'; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | return $operations; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | protected function prepareEnum(Driver $driver): string |
| 294 | 294 | { |
| 295 | 295 | //Postgres enums are just constrained strings |
| 296 | - return '(' . $this->size . ')'; |
|
| 296 | + return '('.$this->size.')'; |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | private function enumConstraint(): string |
| 308 | 308 | { |
| 309 | 309 | if (empty($this->constrainName)) { |
| 310 | - $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 310 | + $this->constrainName = $this->table.'_'.$this->getName().'_enum_'.uniqid(); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return $this->constrainName; |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | $constraints = $driver->query($query, [ |
| 406 | 406 | $tableOID, |
| 407 | - '(' . $column->name . '%', |
|
| 408 | - '("' . $column->name . '%' |
|
| 407 | + '('.$column->name.'%', |
|
| 408 | + '("'.$column->name.'%' |
|
| 409 | 409 | ]); |
| 410 | 410 | |
| 411 | 411 | foreach ($constraints as $constraint) { |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | private static function resolveEnum(Driver $driver, PostgresColumn $column) |
| 437 | 437 | { |
| 438 | - $range = $driver->query('SELECT enum_range(NULL::' . $column->type . ')')->fetchColumn(0); |
|
| 438 | + $range = $driver->query('SELECT enum_range(NULL::'.$column->type.')')->fetchColumn(0); |
|
| 439 | 439 | |
| 440 | 440 | $column->enumValues = explode(',', substr($range, 1, -1)); |
| 441 | 441 | |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | AbstractColumn $column |
| 107 | 107 | ) { |
| 108 | 108 | $this->run("sp_rename ?, ?, 'COLUMN'", [ |
| 109 | - $table->getName() . '.' . $initial->getName(), |
|
| 109 | + $table->getName().'.'.$initial->getName(), |
|
| 110 | 110 | $column->getName() |
| 111 | 111 | ]); |
| 112 | 112 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | $type = "ALTER COLUMN {$driver->identifier($this->getName())} varchar($enumSize)"; |
| 253 | - $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL'); |
|
| 253 | + $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL'); |
|
| 254 | 254 | } else { |
| 255 | 255 | $type = "ALTER COLUMN {$driver->identifier($this->getName())} {$this->type}"; |
| 256 | 256 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $type .= "($this->precision, $this->scale)"; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL'); |
|
| 265 | + $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL'); |
|
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | protected function enumConstraint() |
| 290 | 290 | { |
| 291 | 291 | if (empty($this->enumConstraint)) { |
| 292 | - $this->enumConstraint = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 292 | + $this->enumConstraint = $this->table.'_'.$this->getName().'_enum_'.uniqid(); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | return $this->enumConstraint; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | protected function defaultConstrain(): string |
| 304 | 304 | { |
| 305 | 305 | if (empty($this->defaultConstraint)) { |
| 306 | - $this->defaultConstraint = $this->table . '_' . $this->getName() . '_default_' . uniqid(); |
|
| 306 | + $this->defaultConstraint = $this->table.'_'.$this->getName().'_default_'.uniqid(); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | return $this->defaultConstraint; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | //We made some assumptions here... |
| 438 | 438 | if (preg_match_all( |
| 439 | - '/' . $name . '=[\']?([^\']+)[\']?/i', |
|
| 439 | + '/'.$name.'=[\']?([^\']+)[\']?/i', |
|
| 440 | 440 | $constraint['definition'], |
| 441 | 441 | $matches |
| 442 | 442 | )) { |
@@ -60,14 +60,14 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function getSchema(string $table, string $database = null): AbstractTable |
| 62 | 62 | { |
| 63 | - if (!isset($this->schemas[$database . '.' . $table])) { |
|
| 63 | + if (!isset($this->schemas[$database.'.'.$table])) { |
|
| 64 | 64 | $schema = $this->getTable($table, $database)->getSchema(); |
| 65 | 65 | |
| 66 | 66 | //We have to declare existed to prevent dropping existed schema |
| 67 | - $this->schemas[$database . '.' . $table] = $schema; |
|
| 67 | + $this->schemas[$database.'.'.$table] = $schema; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - return $this->schemas[$database . '.' . $table]; |
|
| 70 | + return $this->schemas[$database.'.'.$table]; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function has(string $name): bool |
| 93 | 93 | { |
| 94 | - return $this->driver->get($this->prefix . $name); |
|
| 94 | + return $this->driver->get($this->prefix.$name); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function get(string $name) |
| 101 | 101 | { |
| 102 | - return $this->driver->get($this->prefix . $name); |
|
| 102 | + return $this->driver->get($this->prefix.$name); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $ttl = 0; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return $this->driver->set($this->prefix . $name, $data, $ttl); |
|
| 117 | + return $this->driver->set($this->prefix.$name, $data, $ttl); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function delete(string $name) |
| 124 | 124 | { |
| 125 | - return $this->driver->delete($this->prefix . $name); |
|
| 125 | + return $this->driver->delete($this->prefix.$name); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function inc(string $name, int $delta = 1): int |
| 132 | 132 | { |
| 133 | - return $this->driver->inc($this->prefix . $name); |
|
| 133 | + return $this->driver->inc($this->prefix.$name); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function dec(string $name, int $delta = 1): int |
| 140 | 140 | { |
| 141 | - return $this->driver->dec($this->prefix . $name, $delta); |
|
| 141 | + return $this->driver->dec($this->prefix.$name, $delta); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | public function has(string $name): bool |
| 70 | 70 | { |
| 71 | 71 | if ($this->driverType == self::APCU_DRIVER) { |
| 72 | - return apcu_exists($this->prefix . $name); |
|
| 72 | + return apcu_exists($this->prefix.$name); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return apc_exists($this->prefix . $name); |
|
| 75 | + return apc_exists($this->prefix.$name); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | public function get(string $name) |
| 82 | 82 | { |
| 83 | 83 | if ($this->driverType == self::APCU_DRIVER) { |
| 84 | - return apcu_fetch($this->prefix . $name); |
|
| 84 | + return apcu_fetch($this->prefix.$name); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return apc_fetch($this->prefix . $name); |
|
| 87 | + return apc_fetch($this->prefix.$name); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | public function set(string $name, $data, $ttl = null) |
| 94 | 94 | { |
| 95 | 95 | if ($this->driverType == self::APCU_DRIVER) { |
| 96 | - return apcu_store($this->prefix . $name, $data, $this->lifetime($ttl, 0)); |
|
| 96 | + return apcu_store($this->prefix.$name, $data, $this->lifetime($ttl, 0)); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - return apc_store($this->prefix . $name, $data, $this->lifetime($ttl, 0)); |
|
| 99 | + return apc_store($this->prefix.$name, $data, $this->lifetime($ttl, 0)); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | public function delete(string $name) |
| 106 | 106 | { |
| 107 | 107 | if ($this->driverType == self::APCU_DRIVER) { |
| 108 | - apcu_delete($this->prefix . $name); |
|
| 108 | + apcu_delete($this->prefix.$name); |
|
| 109 | 109 | |
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - apc_delete($this->prefix . $name); |
|
| 113 | + apc_delete($this->prefix.$name); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | public function inc(string $name, int $delta = 1): int |
| 120 | 120 | { |
| 121 | 121 | if ($this->driverType == self::APCU_DRIVER) { |
| 122 | - return apcu_inc($this->prefix . $name, $delta); |
|
| 122 | + return apcu_inc($this->prefix.$name, $delta); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - return apc_inc($this->prefix . $name, $delta); |
|
| 125 | + return apc_inc($this->prefix.$name, $delta); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | public function dec(string $name, int $delta = 1): int |
| 132 | 132 | { |
| 133 | 133 | if ($this->driverType == self::APCU_DRIVER) { |
| 134 | - return apcu_dec($this->prefix . $name, $delta); |
|
| 134 | + return apcu_dec($this->prefix.$name, $delta); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - return apc_dec($this->prefix . $name, $delta); |
|
| 137 | + return apc_dec($this->prefix.$name, $delta); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function has(string $name): bool |
| 43 | 43 | { |
| 44 | - return xcache_isset($this->prefix . $name); |
|
| 44 | + return xcache_isset($this->prefix.$name); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function get(string $name) |
| 51 | 51 | { |
| 52 | - return xcache_get($this->prefix . $name); |
|
| 52 | + return xcache_get($this->prefix.$name); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function set(string $name, $data, $ttl = null) |
| 59 | 59 | { |
| 60 | - return xcache_set($this->prefix . $name, $data, $this->lifetime($ttl, 0)); |
|
| 60 | + return xcache_set($this->prefix.$name, $data, $this->lifetime($ttl, 0)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function delete(string $name) |
| 67 | 67 | { |
| 68 | - xcache_unset($this->prefix . $name); |
|
| 68 | + xcache_unset($this->prefix.$name); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function inc(string $name, int $delta = 1): int |
| 75 | 75 | { |
| 76 | - return xcache_inc($this->prefix . $name, $delta); |
|
| 76 | + return xcache_inc($this->prefix.$name, $delta); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function dec(string $name, int $delta = 1): int |
| 83 | 83 | { |
| 84 | - return xcache_dec($this->prefix . $name, $delta); |
|
| 84 | + return xcache_dec($this->prefix.$name, $delta); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |