@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * $post = new Post(); |
| 227 | 227 | * $post->user = new User(); |
| 228 | 228 | * |
| 229 | - * @return RelationInterface[]|\Generator |
|
| 229 | + * @return \Generator |
|
| 230 | 230 | */ |
| 231 | 231 | protected function leadingRelations() |
| 232 | 232 | { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * $post = new Post(); |
| 246 | 246 | * $post->comments->add(new Comment()); |
| 247 | 247 | * |
| 248 | - * @return RelationInterface[]|\Generator |
|
| 248 | + * @return \Generator |
|
| 249 | 249 | */ |
| 250 | 250 | protected function dependedRelations() |
| 251 | 251 | { |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | $class = (new \ReflectionClass($accessor->getClass()))->getShortName(); |
| 213 | 213 | |
| 214 | 214 | //[+] for loaded, [~] for lazy loaded |
| 215 | - $relations[$relation] = $type . '(' . $class . ') [' . ($accessor->isLoaded() ? '+]' : '~]'); |
|
| 215 | + $relations[$relation] = $type.'('.$class.') ['.($accessor->isLoaded() ? '+]' : '~]'); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | return $relations; |
@@ -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 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function execute() |
| 56 | 56 | { |
| 57 | - $this->insertID = $this->table->insertOne($this->context + $this->data); |
|
| 57 | + $this->insertID = $this->table->insertOne($this->context + $this->data); |
|
| 58 | 58 | parent::execute(); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | /** |
| 90 | 90 | * Particular case when parent entity exists but now saved yet AND outer key is PK. |
| 91 | 91 | */ |
| 92 | - $leadingCommand->onExecute(function (InsertCommand $related) use ($command) { |
|
| 92 | + $leadingCommand->onExecute(function(InsertCommand $related) use ($command) { |
|
| 93 | 93 | $command->addContext($this->schema[Record::INNER_KEY], $related->getInsertID()); |
| 94 | 94 | }); |
| 95 | 95 | } elseif ($this->changed) { |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | * |
| 103 | 103 | * Basically inversed case of BELONGS_TO. |
| 104 | 104 | */ |
| 105 | - $command->onExecute(function (InsertCommand $command) use ($related) { |
|
| 105 | + $command->onExecute(function(InsertCommand $command) use ($related) { |
|
| 106 | 106 | $related->addContext($this->schema[Record::OUTER_KEY], $command->getInsertID()); |
| 107 | 107 | }); |
| 108 | 108 | } elseif ($this->changed) { |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | } |
| 108 | 108 | } elseif (!is_a($value, $this->class, false)) { |
| 109 | 109 | throw new RelationException( |
| 110 | - "Must be an instance of '{$this->class}', '" . get_class($value) . "' given" |
|
| 110 | + "Must be an instance of '{$this->class}', '".get_class($value)."' given" |
|
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | 113 | } |