@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if (!empty($limit) || !empty($offset)) { |
| 32 | 32 | //When limit is not provided (or 0) but offset does we can replace |
| 33 | 33 | //limit value with PHP_INT_MAX |
| 34 | - $statement = 'LIMIT ' . ($limit ?: '18446744073709551615') . ' '; |
|
| 34 | + $statement = 'LIMIT '.($limit ?: '18446744073709551615').' '; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (!empty($offset)) { |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function identifier(string $identifier): string |
| 52 | 52 | { |
| 53 | - return $identifier == '*' ? '*' : '`' . str_replace('`', '``', $identifier) . '`'; |
|
| 53 | + return $identifier == '*' ? '*' : '`'.str_replace('`', '``', $identifier).'`'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | throw new SchemaException('MySQLHandler can process only MySQL tables'); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return parent::createStatement($table) . " ENGINE {$table->getEngine()}"; |
|
| 87 | + return parent::createStatement($table)." ENGINE {$table->getEngine()}"; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | public function fullName(): string |
| 83 | 83 | { |
| 84 | - return $this->database->getPrefix() . $this->name; |
|
| 84 | + return $this->database->getPrefix().$this->name; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $this->logger()->info("Transaction: new savepoint 'SVP{$name}'"); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - $this->statement('SAVEPOINT ' . $this->identifier("SVP{$name}")); |
|
| 331 | + $this->statement('SAVEPOINT '.$this->identifier("SVP{$name}")); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $this->logger()->info("Transaction: release savepoint 'SVP{$name}'"); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - $this->statement('RELEASE SAVEPOINT ' . $this->identifier("SVP{$name}")); |
|
| 348 | + $this->statement('RELEASE SAVEPOINT '.$this->identifier("SVP{$name}")); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -362,6 +362,6 @@ discard block |
||
| 362 | 362 | $this->logger()->info("Transaction: rollback savepoint 'SVP{$name}'"); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - $this->statement('ROLLBACK TO SAVEPOINT ' . $this->identifier("SVP{$name}")); |
|
| 365 | + $this->statement('ROLLBACK TO SAVEPOINT '.$this->identifier("SVP{$name}")); |
|
| 366 | 366 | } |
| 367 | 367 | } |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | { |
| 91 | 91 | if (defined('static::GUARD_NAMESPACE')) { |
| 92 | 92 | //Yay! Isolation |
| 93 | - $permission = constant(get_called_class() . '::' . 'GUARD_NAMESPACE') . '.' . $permission; |
|
| 93 | + $permission = constant(get_called_class().'::'.'GUARD_NAMESPACE').'.'.$permission; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return $permission; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $migration = $migration->withCapsule($capsule); |
| 137 | 137 | |
| 138 | 138 | //Executing migration inside global transaction |
| 139 | - $this->execute(function () use ($migration) { |
|
| 139 | + $this->execute(function() use ($migration) { |
|
| 140 | 140 | $migration->up(); |
| 141 | 141 | }); |
| 142 | 142 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $migration = $migration->withCapsule($capsule); |
| 183 | 183 | |
| 184 | 184 | //Executing migration inside global transaction |
| 185 | - $this->execute(function () use ($migration) { |
|
| 185 | + $this->execute(function() use ($migration) { |
|
| 186 | 186 | $migration->down(); |
| 187 | 187 | }); |
| 188 | 188 | |
@@ -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 | |
@@ -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 | } |