@@ -210,7 +210,7 @@ |
||
| 210 | 210 | $class = (new \ReflectionClass($accessor->getClass()))->getShortName(); |
| 211 | 211 | |
| 212 | 212 | //[+] for loaded, [~] for lazy loaded |
| 213 | - $relations[$relation] = $type . '(' . $class . ') [' . ($accessor->isLoaded() ? '+]' : '~]'); |
|
| 213 | + $relations[$relation] = $type.'('.$class.') ['.($accessor->isLoaded() ? '+]' : '~]'); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | return $relations; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | //Syncing pivot data values |
| 298 | - $command->onComplete(function (ContextualCommandInterface $command) use ($record) { |
|
| 298 | + $command->onComplete(function(ContextualCommandInterface $command) use ($record) { |
|
| 299 | 299 | //Now when we are done we can sync our values with current data |
| 300 | 300 | $this->pivotData->offsetSet( |
| 301 | 301 | $record, |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | ContextualCommandInterface $outerCommand |
| 343 | 343 | ) { |
| 344 | 344 | //Parent record dependency |
| 345 | - $parentCommand->onExecute(function ($parentCommand) use ($pivotCommand, $parent) { |
|
| 345 | + $parentCommand->onExecute(function($parentCommand) use ($pivotCommand, $parent) { |
|
| 346 | 346 | $pivotCommand->addContext( |
| 347 | 347 | $this->key(Record::THOUGHT_INNER_KEY), |
| 348 | 348 | $this->lookupKey(Record::INNER_KEY, $parent, $parentCommand) |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | }); |
| 351 | 351 | |
| 352 | 352 | //Outer record dependency |
| 353 | - $outerCommand->onExecute(function ($outerCommand) use ($pivotCommand, $outer) { |
|
| 353 | + $outerCommand->onExecute(function($outerCommand) use ($pivotCommand, $outer) { |
|
| 354 | 354 | $pivotCommand->addContext( |
| 355 | 355 | $this->key(Record::THOUGHT_OUTER_KEY), |
| 356 | 356 | $this->lookupKey(Record::OUTER_KEY, $outer, $outerCommand) |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $loader, |
| 427 | 427 | [ |
| 428 | 428 | 'alias' => $table->getName(), |
| 429 | - 'pivotAlias' => $table->getName() . '_pivot', |
|
| 429 | + 'pivotAlias' => $table->getName().'_pivot', |
|
| 430 | 430 | 'method' => RelationLoader::POSTLOAD |
| 431 | 431 | ] |
| 432 | 432 | ); |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $query = $loader->configureQuery($query, [$innerKey]); |
| 437 | 437 | |
| 438 | 438 | //Additional pivot conditions |
| 439 | - $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName() . '_pivot'); |
|
| 439 | + $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName().'_pivot'); |
|
| 440 | 440 | $pivotDecorator->where($this->schema[Record::WHERE_PIVOT]); |
| 441 | 441 | |
| 442 | 442 | //Additional where conditions! |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | { |
| 504 | 504 | if ($diff = array_diff(array_keys($pivotData), $this->schema[Record::PIVOT_COLUMNS])) { |
| 505 | 505 | throw new RelationException( |
| 506 | - "Invalid pivot data, undefined columns found: " . join(', ', $diff) |
|
| 506 | + "Invalid pivot data, undefined columns found: ".join(', ', $diff) |
|
| 507 | 507 | ); |
| 508 | 508 | } |
| 509 | 509 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | //Inversed version of BelongsTo |
| 90 | 90 | if (!$this->isSynced($this->parent, $this->instance)) { |
| 91 | 91 | //Syncing FKs after primary command been executed |
| 92 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
| 92 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
| 93 | 93 | $innerCommand->addContext( |
| 94 | 94 | $this->key(Record::OUTER_KEY), |
| 95 | 95 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | if (!empty($morphKey = $this->key(Record::MORPH_KEY))) { |
| 121 | 121 | //HasOne relation support additional morph key |
| 122 | - $where['{@}.' . $this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
| 122 | + $where['{@}.'.$this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
| 123 | 123 | get_class($this->parent), |
| 124 | 124 | ORMInterface::R_ROLE_NAME |
| 125 | 125 | ); |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | |
| 81 | 81 | if (!$this->isSynced($this->parent, $this->instance)) { |
| 82 | 82 | //Syncing FKs before primary command been executed |
| 83 | - $innerCommand->onExecute(function ($innerCommand) use ($parentCommand) { |
|
| 83 | + $innerCommand->onExecute(function($innerCommand) use ($parentCommand) { |
|
| 84 | 84 | $parentCommand->addContext( |
| 85 | 85 | $this->key(Record::INNER_KEY), |
| 86 | 86 | $this->lookupKey(Record::OUTER_KEY, $this->parent, $innerCommand) |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | if (!$this->isSynced($this->parent, $instance)) { |
| 202 | 202 | //Delayed linking |
| 203 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
| 203 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
| 204 | 204 | $innerCommand->addContext( |
| 205 | 205 | $this->key(Record::OUTER_KEY), |
| 206 | 206 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | //Morph key |
| 259 | 259 | $decorator = new WhereDecorator($selector, 'where', $selector->getAlias()); |
| 260 | 260 | $decorator->where( |
| 261 | - '{@}.' . $this->key(Record::MORPH_KEY), |
|
| 261 | + '{@}.'.$this->key(Record::MORPH_KEY), |
|
| 262 | 262 | $this->orm->define(get_class($this->parent), ORMInterface::R_ROLE_NAME) |
| 263 | 263 | ); |
| 264 | 264 | } |
@@ -153,11 +153,11 @@ |
||
| 153 | 153 | } |
| 154 | 154 | } elseif (!is_object($value)) { |
| 155 | 155 | throw new RelationException( |
| 156 | - "Must be an instance of '{$this->class}', '" . gettype($value) . "' given" |
|
| 156 | + "Must be an instance of '{$this->class}', '".gettype($value)."' given" |
|
| 157 | 157 | ); |
| 158 | 158 | } elseif (!is_a($value, $this->class, false)) { |
| 159 | 159 | throw new RelationException( |
| 160 | - "Must be an instance of '{$this->class}', '" . get_class($value) . "' given" |
|
| 160 | + "Must be an instance of '{$this->class}', '".get_class($value)."' given" |
|
| 161 | 161 | ); |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $pivotData = $data[ORMInterface::PIVOT_DATA]; |
| 97 | 97 | |
| 98 | 98 | //Unique row criteria |
| 99 | - return $pivotData[$this->innerPivotKey] . '.' . $pivotData[$this->outerPivotKey]; |
|
| 99 | + return $pivotData[$this->innerPivotKey].'.'.$pivotData[$this->outerPivotKey]; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | \ No newline at end of file |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | return null; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - return $this->getAlias() . '.' . $this->schema[$key]; |
|
| 237 | + return $this->getAlias().'.'.$this->schema[$key]; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | protected function parentKey($key): string |
| 248 | 248 | { |
| 249 | - return $this->parent->getAlias() . '.' . $this->schema[$key]; |
|
| 249 | + return $this->parent->getAlias().'.'.$this->schema[$key]; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | if (empty($this->options['alias'])) { |
| 261 | 261 | if ($this->isLoaded() && $this->isJoined()) { |
| 262 | 262 | //Let's create unique alias, we are able to do that for relations just loaded |
| 263 | - $this->options['alias'] = 'd' . decoct(++self::$countLevels); |
|
| 263 | + $this->options['alias'] = 'd'.decoct(++self::$countLevels); |
|
| 264 | 264 | } else { |
| 265 | 265 | //Let's use parent alias to continue chain |
| 266 | - $this->options['alias'] = $parent->getAlias() . '_' . $this->relation; |
|
| 266 | + $this->options['alias'] = $parent->getAlias().'_'.$this->relation; |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | if ($this->isJoined()) { |
| 84 | 84 | $query->join( |
| 85 | 85 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
| 86 | - $this->pivotTable() . ' AS ' . $this->pivotAlias()) |
|
| 86 | + $this->pivotTable().' AS '.$this->pivotAlias()) |
|
| 87 | 87 | ->on( |
| 88 | 88 | $this->pivotKey(Record::THOUGHT_INNER_KEY), |
| 89 | 89 | $this->parentKey(Record::INNER_KEY) |
| 90 | 90 | ); |
| 91 | 91 | } else { |
| 92 | 92 | $query->innerJoin( |
| 93 | - $this->pivotTable() . ' AS ' . $this->pivotAlias()) |
|
| 93 | + $this->pivotTable().' AS '.$this->pivotAlias()) |
|
| 94 | 94 | ->on( |
| 95 | 95 | $this->pivotKey(Record::THOUGHT_OUTER_KEY), |
| 96 | 96 | $this->localKey(Record::OUTER_KEY) |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | //Actual data is always INNER join |
| 129 | 129 | $query->join( |
| 130 | 130 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
| 131 | - $this->getTable() . ' AS ' . $this->getAlias() |
|
| 131 | + $this->getTable().' AS '.$this->getAlias() |
|
| 132 | 132 | )->on( |
| 133 | 133 | $this->localKey(Record::OUTER_KEY), |
| 134 | 134 | $this->pivotKey(Record::THOUGHT_OUTER_KEY) |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | if ($minify) { |
| 170 | 170 | //Let's use column number instead of full name |
| 171 | - $column = 'p_c' . count($columns); |
|
| 171 | + $column = 'p_c'.count($columns); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | $columns[] = "{$alias}.{$name} AS {$prefix}{$column}"; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | return $this->options['pivotAlias']; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - return $this->getAlias() . '_pivot'; |
|
| 220 | + return $this->getAlias().'_pivot'; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | return null; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - return $this->pivotAlias() . '.' . $this->schema[$key]; |
|
| 246 | + return $this->pivotAlias().'.'.$this->schema[$key]; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |