| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | /** | 
| 26 | 26 | * Set of allowed enum values. | 
| 27 | 27 | */ | 
| 28 | - const VALUES = []; | |
| 28 | + const VALUES = []; | |
| 29 | 29 | |
| 30 | 30 | /** | 
| 31 | 31 | * Default value. | 
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | |
| 62 | 62 | $schemas[] = $this->container->get(FactoryInterface::class)->make( | 
| 63 | 63 | RecordSchema::class, | 
| 64 | - ['reflection' => new ReflectionEntity($class['name']),] | |
| 64 | + ['reflection' => new ReflectionEntity($class['name']), ] | |
| 65 | 65 | ); | 
| 66 | 66 | } | 
| 67 | 67 | |
| @@ -123,8 +123,8 @@ discard block | ||
| 123 | 123 | * | 
| 124 | 124 | * @see Record::INDEXES | 
| 125 | 125 | */ | 
| 126 | - const INDEX = 1000; //Default index type | |
| 127 | - const UNIQUE = 2000; //Unique index definition | |
| 126 | + const INDEX = 1000; //Default index type | |
| 127 | + const UNIQUE = 2000; //Unique index definition | |
| 128 | 128 | |
| 129 | 129 | /* | 
| 130 | 130 | * ================================================ | 
| @@ -330,12 +330,12 @@ discard block | ||
| 330 | 330 | $command = new InsertCommand($this->orm->table(static::class), $data); | 
| 331 | 331 | |
| 332 | 332 | //Executed when transaction successfully completed | 
| 333 | -        $command->onComplete(function (InsertCommand $command) { | |
| 333 | +        $command->onComplete(function(InsertCommand $command) { | |
| 334 | 334 | $this->lastInsert = null; | 
| 335 | 335 | $this->handleInsert($command); | 
| 336 | 336 | }); | 
| 337 | 337 | |
| 338 | -        $command->onRollBack(function () { | |
| 338 | +        $command->onRollBack(function() { | |
| 339 | 339 | //Flushing existed insert command to prevent collisions | 
| 340 | 340 | $this->lastInsert = null; | 
| 341 | 341 | $this->state = ORMInterface::STATE_NEW; | 
| @@ -363,7 +363,7 @@ discard block | ||
| 363 | 363 | ); | 
| 364 | 364 | |
| 365 | 365 |          if (!empty($this->lastInsert)) { | 
| 366 | -            $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { | |
| 366 | +            $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { | |
| 367 | 367 | //Sync primary key values | 
| 368 | 368 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); | 
| 369 | 369 | $command->setPrimaryKey($insert->getInsertID()); | 
| @@ -371,11 +371,11 @@ discard block | ||
| 371 | 371 | } | 
| 372 | 372 | |
| 373 | 373 | //Executed when transaction successfully completed | 
| 374 | -        $command->onComplete(function (UpdateCommand $command) { | |
| 374 | +        $command->onComplete(function(UpdateCommand $command) { | |
| 375 | 375 | $this->handleUpdate($command); | 
| 376 | 376 | }); | 
| 377 | 377 | |
| 378 | -        $command->onRollBack(function () { | |
| 378 | +        $command->onRollBack(function() { | |
| 379 | 379 | //Flushing existed insert command to prevent collisions | 
| 380 | 380 | $this->state = ORMInterface::STATE_LOADED; | 
| 381 | 381 | }); | 
| @@ -399,13 +399,13 @@ discard block | ||
| 399 | 399 | |
| 400 | 400 |          if (!empty($this->lastInsert)) { | 
| 401 | 401 | //Sync primary key values | 
| 402 | -            $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { | |
| 402 | +            $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { | |
| 403 | 403 | $command->setWhere([$this->primaryColumn() => $insert->primaryKey()]); | 
| 404 | 404 | }); | 
| 405 | 405 | } | 
| 406 | 406 | |
| 407 | 407 | //Executed when transaction successfully completed | 
| 408 | -        $command->onComplete(function (DeleteCommand $command) { | |
| 408 | +        $command->onComplete(function(DeleteCommand $command) { | |
| 409 | 409 | $this->handleDelete($command); | 
| 410 | 410 | }); | 
| 411 | 411 | |
| @@ -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) | 
| @@ -63,10 +63,10 @@ discard block | ||
| 63 | 63 | } | 
| 64 | 64 | |
| 65 | 65 |          if (empty($entity->primaryKey())) { | 
| 66 | -            throw new MapException("Unable to store non identified entity " . get_class($entity)); | |
| 66 | +            throw new MapException("Unable to store non identified entity ".get_class($entity)); | |
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | - $cacheID = get_class($entity) . ':' . $entity->primaryKey(); | |
| 69 | + $cacheID = get_class($entity).':'.$entity->primaryKey(); | |
| 70 | 70 | |
| 71 | 71 | return $this->entities[$cacheID] = $entity; | 
| 72 | 72 | } | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | */ | 
| 79 | 79 | public function forget(RecordInterface $entity) | 
| 80 | 80 |      { | 
| 81 | - $cacheID = get_class($entity) . ':' . $entity->primaryKey(); | |
| 81 | + $cacheID = get_class($entity).':'.$entity->primaryKey(); | |
| 82 | 82 | unset($this->entities[$cacheID]); | 
| 83 | 83 | } | 
| 84 | 84 | |
| @@ -230,7 +230,7 @@ | ||
| 230 | 230 | public function __toString() | 
| 231 | 231 |      { | 
| 232 | 232 | //Do we need to worry about collision rate in this context? | 
| 233 | -        return static::class . '#' . hash('crc32', spl_object_hash($this)); | |
| 233 | +        return static::class.'#'.hash('crc32', spl_object_hash($this)); | |
| 234 | 234 | } | 
| 235 | 235 | |
| 236 | 236 | /** | 
| @@ -307,6 +307,6 @@ | ||
| 307 | 307 | $names = [$source->getRole(), $target->getRole()]; | 
| 308 | 308 | asort($names); | 
| 309 | 309 | |
| 310 | -        return implode('_', $names) . static::PIVOT_POSTFIX; | |
| 310 | +        return implode('_', $names).static::PIVOT_POSTFIX; | |
| 311 | 311 | } | 
| 312 | 312 | } | 
| 313 | 313 | \ No newline at end of file | 
| @@ -55,7 +55,7 @@ | ||
| 55 | 55 | */ | 
| 56 | 56 | public function getName(): string | 
| 57 | 57 |      { | 
| 58 | -        $name = ($this->isUnique() ? 'unique_' : 'index_') . join('_', $this->getColumns()); | |
| 58 | +        $name = ($this->isUnique() ? 'unique_' : 'index_').join('_', $this->getColumns()); | |
| 59 | 59 | |
| 60 | 60 | return strlen($name) > 64 ? md5($name) : $name; | 
| 61 | 61 | } | 
| @@ -279,7 +279,7 @@ | ||
| 279 | 279 |              if (!empty($filter = $this->mutatorsConfig->getMutators($column->abstractType()))) { | 
| 280 | 280 | //Mutator associated with type directly | 
| 281 | 281 | $resolved += $filter; | 
| 282 | -            } elseif (!empty($filter = $this->mutatorsConfig->getMutators('php:' . $column->phpType()))) { | |
| 282 | +            } elseif (!empty($filter = $this->mutatorsConfig->getMutators('php:'.$column->phpType()))) { | |
| 283 | 283 | //Mutator associated with php type | 
| 284 | 284 | $resolved += $filter; | 
| 285 | 285 | } |