@@ -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 |
@@ -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 | */ |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * Class PrimaryKey |
55 | 55 | * @package Platine\Orm\Relation |
56 | 56 | */ |
57 | -class PrimaryKey |
|
58 | -{ |
|
57 | +class PrimaryKey { |
|
59 | 58 | /** |
60 | 59 | * |
61 | 60 | * @var array<int, string> |
@@ -72,8 +71,7 @@ discard block |
||
72 | 71 | * Create new instance |
73 | 72 | * @param string ...$columns |
74 | 73 | */ |
75 | - public function __construct(string ...$columns) |
|
76 | - { |
|
74 | + public function __construct(string ...$columns) { |
|
77 | 75 | $this->columns = $columns; |
78 | 76 | $this->composite = count($columns) > 1; |
79 | 77 | } |
@@ -103,8 +101,7 @@ discard block |
||
103 | 101 | * |
104 | 102 | * @return mixed|array<string, mixed>|null |
105 | 103 | */ |
106 | - public function getValue(array $columns, bool $map = false) |
|
107 | - { |
|
104 | + public function getValue(array $columns, bool $map = false) { |
|
108 | 105 | if (!$this->composite && !$map) { |
109 | 106 | return isset($columns[$this->columns[0]]) |
110 | 107 | ? $columns[$this->columns[0]] |
@@ -129,8 +126,7 @@ discard block |
||
129 | 126 | * |
130 | 127 | * @return mixed|array<string, mixed>|null |
131 | 128 | */ |
132 | - public function getValueFromDataMapper(DataMapper $mapper, bool $map = false) |
|
133 | - { |
|
129 | + public function getValueFromDataMapper(DataMapper $mapper, bool $map = false) { |
|
134 | 130 | return $this->getValue($mapper->getRawColumns(), $map); |
135 | 131 | } |
136 | 132 | |
@@ -140,8 +136,7 @@ discard block |
||
140 | 136 | * @param bool $map |
141 | 137 | * @return mixed|array<string, mixed>|null |
142 | 138 | */ |
143 | - public function getValueFromEntity(Entity $entity, bool $map = false) |
|
144 | - { |
|
139 | + public function getValueFromEntity(Entity $entity, bool $map = false) { |
|
145 | 140 | $columns = Proxy::instance()->getEntityColumns($entity); |
146 | 141 | return $this->getValue($columns, $map); |
147 | 142 | } |