@@ -67,7 +67,7 @@ |
||
| 67 | 67 | return $this->name; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $name = ($this->isUnique() ? 'unique_' : 'index_') . join('_', $this->getColumns()); |
|
| 70 | + $name = ($this->isUnique() ? 'unique_' : 'index_').join('_', $this->getColumns()); |
|
| 71 | 71 | |
| 72 | 72 | return strlen($name) > 64 ? md5($name) : $name; |
| 73 | 73 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 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 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | if ($key == RecordEntity::INDEX || $key == RecordEntity::UNIQUE) { |
| 341 | 341 | $unique = ($key === RecordEntity::UNIQUE); |
| 342 | 342 | |
| 343 | - if (!is_string($value) || empty($value)){ |
|
| 343 | + if (!is_string($value) || empty($value)) { |
|
| 344 | 344 | throw new DefinitionException( |
| 345 | 345 | "Record '{$this}' has index definition with invalid index name" |
| 346 | 346 | ); |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | * |
| 146 | 146 | * @see Record::INDEXES |
| 147 | 147 | */ |
| 148 | - const INDEX = 1000; //Default index type |
|
| 149 | - const UNIQUE = 2000; //Unique index definition |
|
| 148 | + const INDEX = 1000; //Default index type |
|
| 149 | + const UNIQUE = 2000; //Unique index definition |
|
| 150 | 150 | |
| 151 | 151 | /* |
| 152 | 152 | * ================================================ |
@@ -351,12 +351,12 @@ discard block |
||
| 351 | 351 | $command = new InsertCommand($this->orm->table(static::class), $data); |
| 352 | 352 | |
| 353 | 353 | //Executed when transaction successfully completed |
| 354 | - $command->onComplete(function (InsertCommand $command) { |
|
| 354 | + $command->onComplete(function(InsertCommand $command) { |
|
| 355 | 355 | $this->lastInsert = null; |
| 356 | 356 | $this->handleInsert($command); |
| 357 | 357 | }); |
| 358 | 358 | |
| 359 | - $command->onRollBack(function () { |
|
| 359 | + $command->onRollBack(function() { |
|
| 360 | 360 | //Flushing existed insert command to prevent collisions |
| 361 | 361 | $this->lastInsert = null; |
| 362 | 362 | $this->state = ORMInterface::STATE_NEW; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | ); |
| 385 | 385 | |
| 386 | 386 | if (!empty($this->lastInsert)) { |
| 387 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 387 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 388 | 388 | //Sync primary key values |
| 389 | 389 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); |
| 390 | 390 | $command->setPrimaryKey($insert->getInsertID()); |
@@ -392,11 +392,11 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | //Executed when transaction successfully completed |
| 395 | - $command->onComplete(function (UpdateCommand $command) { |
|
| 395 | + $command->onComplete(function(UpdateCommand $command) { |
|
| 396 | 396 | $this->handleUpdate($command); |
| 397 | 397 | }); |
| 398 | 398 | |
| 399 | - $command->onRollBack(function () { |
|
| 399 | + $command->onRollBack(function() { |
|
| 400 | 400 | //Flushing existed insert command to prevent collisions |
| 401 | 401 | $this->state = ORMInterface::STATE_LOADED; |
| 402 | 402 | }); |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | if (!empty($this->lastInsert)) { |
| 422 | 422 | //Sync primary key values |
| 423 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 423 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 424 | 424 | $command->setWhere([$this->primaryColumn() => $insert->primaryKey()]); |
| 425 | 425 | }); |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | //Executed when transaction successfully completed |
| 429 | - $command->onComplete(function (DeleteCommand $command) { |
|
| 429 | + $command->onComplete(function(DeleteCommand $command) { |
|
| 430 | 430 | $this->handleDelete($command); |
| 431 | 431 | }); |
| 432 | 432 | |