@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | //Dropping enum constrain before any operation |
| 270 | 270 | if ($initial->abstractType() == 'enum' && $this->constrained) { |
| 271 | - $operations[] = 'DROP CONSTRAINT ' . $driver->identifier($this->enumConstraint()); |
|
| 271 | + $operations[] = 'DROP CONSTRAINT '.$driver->identifier($this->enumConstraint()); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | //Default value set and dropping |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | //Nullable option |
| 284 | 284 | if ($initial->nullable != $this->nullable) { |
| 285 | - $operations[] = "ALTER COLUMN {$identifier} " . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL'; |
|
| 285 | + $operations[] = "ALTER COLUMN {$identifier} ".(!$this->nullable ? 'SET' : 'DROP').' NOT NULL'; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if ($this->abstractType() == 'enum') { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $operations[] = "ADD CONSTRAINT {$driver->identifier($this->enumConstraint())} " |
| 295 | - . "CHECK ({$identifier} IN (" . implode(', ', $enumValues) . '))'; |
|
| 295 | + . "CHECK ({$identifier} IN (".implode(', ', $enumValues).'))'; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | return $operations; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | protected function quoteEnum(Driver $driver): string |
| 305 | 305 | { |
| 306 | 306 | //Postgres enums are just constrained strings |
| 307 | - return '(' . $this->size . ')'; |
|
| 307 | + return '('.$this->size.')'; |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | private function enumConstraint(): string |
| 316 | 316 | { |
| 317 | 317 | if (empty($this->constrainName)) { |
| 318 | - $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
| 318 | + $this->constrainName = $this->table.'_'.$this->getName().'_enum_'.uniqid(); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | return $this->constrainName; |
@@ -419,11 +419,11 @@ discard block |
||
| 419 | 419 | |
| 420 | 420 | $constraints = $driver->query($query, [ |
| 421 | 421 | $tableOID, |
| 422 | - '(' . $column->name . '%', |
|
| 423 | - '("' . $column->name . '%', |
|
| 422 | + '('.$column->name.'%', |
|
| 423 | + '("'.$column->name.'%', |
|
| 424 | 424 | //Postgres magic |
| 425 | - $column->name . '::text%', |
|
| 426 | - '%(' . $column->name . ')::text%' |
|
| 425 | + $column->name.'::text%', |
|
| 426 | + '%('.$column->name.')::text%' |
|
| 427 | 427 | ]); |
| 428 | 428 | |
| 429 | 429 | foreach ($constraints as $constraint) { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | private static function resolveEnum(Driver $driver, PostgresColumn $column) |
| 455 | 455 | { |
| 456 | - $range = $driver->query('SELECT enum_range(NULL::' . $column->type . ')')->fetchColumn(0); |
|
| 456 | + $range = $driver->query('SELECT enum_range(NULL::'.$column->type.')')->fetchColumn(0); |
|
| 457 | 457 | |
| 458 | 458 | $column->enumValues = explode(',', substr($range, 1, -1)); |
| 459 | 459 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @see Record::INDEXES |
| 99 | 99 | */ |
| 100 | - const INDEX = 1000; //Default index type |
|
| 101 | - const UNIQUE = 2000; //Unique index definition |
|
| 100 | + const INDEX = 1000; //Default index type |
|
| 101 | + const UNIQUE = 2000; //Unique index definition |
|
| 102 | 102 | |
| 103 | 103 | /* |
| 104 | 104 | * ================================================ |
@@ -302,11 +302,11 @@ discard block |
||
| 302 | 302 | $this->dispatch('insert', new RecordEvent($this, $command)); |
| 303 | 303 | |
| 304 | 304 | //Executed when transaction successfully completed |
| 305 | - $command->onComplete(function (InsertCommand $command) { |
|
| 305 | + $command->onComplete(function(InsertCommand $command) { |
|
| 306 | 306 | $this->handleInsert($command); |
| 307 | 307 | }); |
| 308 | 308 | |
| 309 | - $command->onRollBack(function () { |
|
| 309 | + $command->onRollBack(function() { |
|
| 310 | 310 | //Flushing existed insert command to prevent collisions |
| 311 | 311 | $this->lastInsert = null; |
| 312 | 312 | $this->state = ORMInterface::STATE_NEW; |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | 331 | if (!empty($this->lastInsert)) { |
| 332 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 332 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 333 | 333 | //Sync primary key values |
| 334 | 334 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); |
| 335 | 335 | $command->setPrimaryKey($insert->getInsertID()); |
@@ -341,11 +341,11 @@ discard block |
||
| 341 | 341 | $this->dispatch('update', new RecordEvent($this)); |
| 342 | 342 | |
| 343 | 343 | //Executed when transaction successfully completed |
| 344 | - $command->onComplete(function (UpdateCommand $command) { |
|
| 344 | + $command->onComplete(function(UpdateCommand $command) { |
|
| 345 | 345 | $this->handleUpdate($command); |
| 346 | 346 | }); |
| 347 | 347 | |
| 348 | - $command->onRollBack(function () { |
|
| 348 | + $command->onRollBack(function() { |
|
| 349 | 349 | //Flushing existed insert command to prevent collisions |
| 350 | 350 | $this->state = ORMInterface::STATE_LOADED; |
| 351 | 351 | }); |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | if (!empty($this->lastInsert)) { |
| 367 | 367 | //Sync primary key values |
| 368 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 368 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 369 | 369 | $command->setWhere([$this->primaryColumn() => $insert->primaryKey()]); |
| 370 | 370 | }); |
| 371 | 371 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $this->dispatch('delete', new RecordEvent($this)); |
| 376 | 376 | |
| 377 | 377 | //Executed when transaction successfully completed |
| 378 | - $command->onComplete(function (DeleteCommand $command) { |
|
| 378 | + $command->onComplete(function(DeleteCommand $command) { |
|
| 379 | 379 | $this->handleDelete($command); |
| 380 | 380 | }); |
| 381 | 381 | |
@@ -165,11 +165,11 @@ |
||
| 165 | 165 | } |
| 166 | 166 | } elseif (!is_object($value)) { |
| 167 | 167 | throw new RelationException( |
| 168 | - "Must be an instance of '{$this->class}', '" . gettype($value) . "' given" |
|
| 168 | + "Must be an instance of '{$this->class}', '".gettype($value)."' given" |
|
| 169 | 169 | ); |
| 170 | 170 | } elseif (!is_a($value, $this->class, false)) { |
| 171 | 171 | throw new RelationException( |
| 172 | - "Must be an instance of '{$this->class}', '" . get_class($value) . "' given" |
|
| 172 | + "Must be an instance of '{$this->class}', '".get_class($value)."' given" |
|
| 173 | 173 | ); |
| 174 | 174 | } |
| 175 | 175 | } |
@@ -224,7 +224,7 @@ |
||
| 224 | 224 | */ |
| 225 | 225 | public function __toString() |
| 226 | 226 | { |
| 227 | - return static::class . '#' . hash('crc32', spl_object_hash($this)); |
|
| 227 | + return static::class.'#'.hash('crc32', spl_object_hash($this)); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | { |
| 321 | 321 | $statement = ''; |
| 322 | 322 | foreach ($joinTokens as $table => $join) { |
| 323 | - $statement .= "\n" . $join['type'] . ' JOIN ' . $this->quote($table, true); |
|
| 323 | + $statement .= "\n".$join['type'].' JOIN '.$this->quote($table, true); |
|
| 324 | 324 | $statement .= $this->optional("\n ON", $this->compileWhere($join['on'])); |
| 325 | 325 | } |
| 326 | 326 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | throw new CompilerException("Invalid sorting direction, only ASC and DESC are allowed"); |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - $result[] = $this->quote($order[0]) . ' ' . $direction; |
|
| 375 | + $result[] = $this->quote($order[0]).' '.$direction; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | return implode(', ', $result); |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | $prefix .= ' '; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - return $prefix . $expression . $postfix; |
|
| 541 | + return $prefix.$expression.$postfix; |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | /** |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | { |
| 598 | 598 | if ($context instanceof QueryBuilder) { |
| 599 | 599 | //Nested queries has to be wrapped with braces |
| 600 | - return '(' . $context->sqlStatement($this) . ')'; |
|
| 600 | + return '('.$context->sqlStatement($this).')'; |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | if ($context instanceof ExpressionInterface) { |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if (empty($entity->primaryKey())) { |
| 65 | - throw new MapException("Unable to store non identified entity " . get_class($entity)); |
|
| 65 | + throw new MapException("Unable to store non identified entity ".get_class($entity)); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $cacheID = get_class($entity) . ':' . $entity->primaryKey(); |
|
| 68 | + $cacheID = get_class($entity).':'.$entity->primaryKey(); |
|
| 69 | 69 | |
| 70 | 70 | return $this->entities[$cacheID] = $entity; |
| 71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function forget(RecordInterface $entity) |
| 79 | 79 | { |
| 80 | - $cacheID = get_class($entity) . ':' . $entity->primaryKey(); |
|
| 80 | + $cacheID = get_class($entity).':'.$entity->primaryKey(); |
|
| 81 | 81 | unset($this->entities[$cacheID]); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | $schemas[] = $this->container->get(FactoryInterface::class)->make( |
| 60 | 60 | DocumentSchema::class, |
| 61 | - ['reflection' => new ReflectionEntity($class['name']),] |
|
| 61 | + ['reflection' => new ReflectionEntity($class['name']), ] |
|
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if (!empty($this->cache) && $this->options['cache']) { |
| 87 | 87 | $this->authToken = $this->cache->get( |
| 88 | - $this->options['username'] . '@rackspace-token' |
|
| 88 | + $this->options['username'].'@rackspace-token' |
|
| 89 | 89 | ); |
| 90 | 90 | |
| 91 | 91 | $this->regions = (array)$this->cache->get( |
| 92 | - $this->options['username'] . '@rackspace-regions' |
|
| 92 | + $this->options['username'].'@rackspace-regions' |
|
| 93 | 93 | ); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | public function exists( |
| 120 | 120 | BucketInterface $bucket, |
| 121 | 121 | string $name, |
| 122 | - ResponseInterface &$response = null |
|
| 122 | + ResponseInterface & $response = null |
|
| 123 | 123 | ): bool { |
| 124 | 124 | try { |
| 125 | 125 | $response = $this->client->send($this->buildRequest('HEAD', $bucket, $name)); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | { |
| 245 | 245 | try { |
| 246 | 246 | $request = $this->buildRequest('PUT', $bucket, $newName, [ |
| 247 | - 'X-Copy-From' => '/' . $bucket->getOption('container') . '/' . rawurlencode($oldName), |
|
| 247 | + 'X-Copy-From' => '/'.$bucket->getOption('container').'/'.rawurlencode($oldName), |
|
| 248 | 248 | 'Content-Length' => 0 |
| 249 | 249 | ]); |
| 250 | 250 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | try { |
| 283 | 283 | $request = $this->buildRequest('PUT', $destination, $name, [ |
| 284 | - 'X-Copy-From' => '/' . $bucket->getOption('container') . '/' . rawurlencode($name), |
|
| 284 | + 'X-Copy-From' => '/'.$bucket->getOption('container').'/'.rawurlencode($name), |
|
| 285 | 285 | 'Content-Length' => 0 |
| 286 | 286 | ]); |
| 287 | 287 | |
@@ -357,13 +357,13 @@ discard block |
||
| 357 | 357 | |
| 358 | 358 | if (!empty($this->cache) && $this->options['cache']) { |
| 359 | 359 | $this->cache->set( |
| 360 | - $username . '@rackspace-token', |
|
| 360 | + $username.'@rackspace-token', |
|
| 361 | 361 | $this->authToken, |
| 362 | 362 | $this->options['lifetime'] |
| 363 | 363 | ); |
| 364 | 364 | |
| 365 | 365 | $this->cache->set( |
| 366 | - $username . '@rackspace-regions', |
|
| 366 | + $username.'@rackspace-regions', |
|
| 367 | 367 | $this->regions, |
| 368 | 368 | $this->options['lifetime'] |
| 369 | 369 | ); |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | return new Uri( |
| 405 | - $this->regions[$region] . '/' . $bucket->getOption('container') . '/' . rawurlencode($name) |
|
| 405 | + $this->regions[$region].'/'.$bucket->getOption('container').'/'.rawurlencode($name) |
|
| 406 | 406 | ); |
| 407 | 407 | } |
| 408 | 408 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | $schemas[] = $this->container->get(FactoryInterface::class)->make( |
| 60 | 60 | DocumentSchema::class, |
| 61 | - ['reflection' => new ReflectionEntity($class['name']),] |
|
| 61 | + ['reflection' => new ReflectionEntity($class['name']), ] |
|
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | 64 | |