@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class EntityStateException |
| 39 | 39 | * @package Platine\Orm\Exception |
| 40 | 40 | */ |
| 41 | -class EntityStateException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class EntityStateException extends RuntimeException { |
|
| 43 | 42 | } |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class RelationNotFoundException |
| 39 | 39 | * @package Platine\Orm\Exception |
| 40 | 40 | */ |
| 41 | -class RelationNotFoundException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class RelationNotFoundException extends RuntimeException { |
|
| 43 | 42 | } |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class PropertyNotFoundException |
| 39 | 39 | * @package Platine\Orm\Exception |
| 40 | 40 | */ |
| 41 | -class PropertyNotFoundException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class PropertyNotFoundException extends RuntimeException { |
|
| 43 | 42 | } |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class EntityMapperInterface |
| 53 | 53 | * @package Platine\Orm\Mapper |
| 54 | 54 | */ |
| 55 | -interface EntityMapperInterface |
|
| 56 | -{ |
|
| 55 | +interface EntityMapperInterface { |
|
| 57 | 56 | /** |
| 58 | 57 | * The name of the entity |
| 59 | 58 | * @param string $name |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * Class EntityMapper |
| 56 | 56 | * @package Platine\Orm\Mapper |
| 57 | 57 | */ |
| 58 | -class EntityMapper implements EntityMapperInterface |
|
| 59 | -{ |
|
| 58 | +class EntityMapper implements EntityMapperInterface { |
|
| 60 | 59 | /** |
| 61 | 60 | * The name of the entity |
| 62 | 61 | * @var string |
@@ -177,8 +176,7 @@ discard block |
||
| 177 | 176 | * Create new instance |
| 178 | 177 | * @param string $entityClass |
| 179 | 178 | */ |
| 180 | - public function __construct(string $entityClass) |
|
| 181 | - { |
|
| 179 | + public function __construct(string $entityClass) { |
|
| 182 | 180 | $this->entityClass = $entityClass; |
| 183 | 181 | } |
| 184 | 182 | |
@@ -435,15 +433,13 @@ discard block |
||
| 435 | 433 | $primaryKey = $this->getPrimaryKey(); |
| 436 | 434 | $prefix = $this->getName(); |
| 437 | 435 | |
| 438 | - $this->foreignKey = new class ($primaryKey, $prefix) extends ForeignKey |
|
| 439 | - { |
|
| 436 | + $this->foreignKey = new class ($primaryKey, $prefix) extends ForeignKey { |
|
| 440 | 437 | /** |
| 441 | 438 | * |
| 442 | 439 | * @param PrimaryKey $primaryKey |
| 443 | 440 | * @param string $prefix |
| 444 | 441 | */ |
| 445 | - public function __construct(PrimaryKey $primaryKey, string $prefix) |
|
| 446 | - { |
|
| 442 | + public function __construct(PrimaryKey $primaryKey, string $prefix) { |
|
| 447 | 443 | /** @var array<string, string> $columns */ |
| 448 | 444 | $columns = []; |
| 449 | 445 | |
@@ -462,8 +458,7 @@ discard block |
||
| 462 | 458 | * |
| 463 | 459 | * @return callable|null |
| 464 | 460 | */ |
| 465 | - public function getPrimaryKeyGenerator() |
|
| 466 | - { |
|
| 461 | + public function getPrimaryKeyGenerator() { |
|
| 467 | 462 | return $this->primaryKeyGenerator; |
| 468 | 463 | } |
| 469 | 464 | |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | * Class DataMapper |
| 68 | 68 | * @package Platine\Orm\Mapper |
| 69 | 69 | */ |
| 70 | -class DataMapper implements DataMapperInterface |
|
| 71 | -{ |
|
| 70 | +class DataMapper implements DataMapperInterface { |
|
| 72 | 71 | /** |
| 73 | 72 | * The raw columns data |
| 74 | 73 | * @var array<string, mixed> |
@@ -230,8 +229,7 @@ discard block |
||
| 230 | 229 | /** |
| 231 | 230 | * {@inheritedoc} |
| 232 | 231 | */ |
| 233 | - public function getColumn(string $name) |
|
| 234 | - { |
|
| 232 | + public function getColumn(string $name) { |
|
| 235 | 233 | if ($this->refresh) { |
| 236 | 234 | $this->hydrate(); |
| 237 | 235 | } |
@@ -352,8 +350,7 @@ discard block |
||
| 352 | 350 | /** |
| 353 | 351 | * {@inheritedoc} |
| 354 | 352 | */ |
| 355 | - public function getRelated(string $name, callable $callback = null) |
|
| 356 | - { |
|
| 353 | + public function getRelated(string $name, callable $callback = null) { |
|
| 357 | 354 | if (array_key_exists($name, $this->relations)) { |
| 358 | 355 | return $this->relations[$name]; |
| 359 | 356 | } |
@@ -612,8 +609,7 @@ discard block |
||
| 612 | 609 | * |
| 613 | 610 | * @return mixed |
| 614 | 611 | */ |
| 615 | - protected function castGet($value, string $type) |
|
| 616 | - { |
|
| 612 | + protected function castGet($value, string $type) { |
|
| 617 | 613 | $original = $type; |
| 618 | 614 | |
| 619 | 615 | if ($type[0] === '?') { |
@@ -663,8 +659,7 @@ discard block |
||
| 663 | 659 | * |
| 664 | 660 | * @return mixed |
| 665 | 661 | */ |
| 666 | - protected function castSet($value, string $type) |
|
| 667 | - { |
|
| 662 | + protected function castSet($value, string $type) { |
|
| 668 | 663 | $original = $type; |
| 669 | 664 | |
| 670 | 665 | if ($type[0] === '?') { |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * Class RepositoryInterface |
| 54 | 54 | * @package Platine\Orm |
| 55 | 55 | */ |
| 56 | -interface RepositoryInterface |
|
| 57 | -{ |
|
| 56 | +interface RepositoryInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * Return the instance of EntityQuery |
| 60 | 59 | * @param string|array<int, string>|array<string, Closure> $with |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class RelationFactory |
| 53 | 53 | * @package Platine\Orm\Relation |
| 54 | 54 | */ |
| 55 | -class RelationFactory |
|
| 56 | -{ |
|
| 55 | +class RelationFactory { |
|
| 57 | 56 | /** |
| 58 | 57 | * The relation name |
| 59 | 58 | * @var string |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * @param string $name |
| 72 | 71 | * @param Closure $callback |
| 73 | 72 | */ |
| 74 | - public function __construct(string $name, Closure $callback) |
|
| 75 | - { |
|
| 73 | + public function __construct(string $name, Closure $callback) { |
|
| 76 | 74 | $this->name = $name; |
| 77 | 75 | $this->callback = $callback; |
| 78 | 76 | } |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * Class HasMany |
| 51 | 51 | * @package Platine\Orm\Relation |
| 52 | 52 | */ |
| 53 | -class HasMany extends HasRelation |
|
| 54 | -{ |
|
| 53 | +class HasMany extends HasRelation { |
|
| 55 | 54 | /** |
| 56 | 55 | * {@inheritedoc} |
| 57 | 56 | */ |