@@ -53,8 +53,7 @@ |
||
53 | 53 | * @package Platine\Orm\Mapper |
54 | 54 | * @template TEntity as \Platine\Orm\Entity |
55 | 55 | */ |
56 | -interface EntityMapperInterface |
|
57 | -{ |
|
56 | +interface EntityMapperInterface { |
|
58 | 57 | /** |
59 | 58 | * The name of the entity |
60 | 59 | * @param string $name |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * @package Platine\Orm\Mapper |
54 | 54 | * @template TEntity as Entity |
55 | 55 | */ |
56 | -interface DataMapperInterface |
|
57 | -{ |
|
56 | +interface DataMapperInterface { |
|
58 | 57 | /** |
59 | 58 | * Whether the record is new |
60 | 59 | * @return bool |
@@ -124,7 +124,7 @@ |
||
124 | 124 | * @param DataMapper<TEntity> $mapper |
125 | 125 | * @return null|TEntity|TEntity[] |
126 | 126 | */ |
127 | - public function getResult(DataMapper $mapper): Entity|array|null |
|
127 | + public function getResult(DataMapper $mapper): Entity | array | null |
|
128 | 128 | { |
129 | 129 | $results = $this->loadResults(); |
130 | 130 |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * @package Platine\Orm\Relation |
57 | 57 | * @template TEntity as Entity |
58 | 58 | */ |
59 | -class RelationLoader |
|
60 | -{ |
|
59 | +class RelationLoader { |
|
61 | 60 | /** |
62 | 61 | * |
63 | 62 | * @var EntityQuery<TEntity> |
@@ -109,5 +109,5 @@ |
||
109 | 109 | abstract public function getResult( |
110 | 110 | DataMapper $mapper, |
111 | 111 | ?callable $callback = null |
112 | - ): Entity|array|null; |
|
112 | + ): Entity | array | null; |
|
113 | 113 | } |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * @package Platine\Orm\Relation |
57 | 57 | * @template TEntity as Entity |
58 | 58 | */ |
59 | -abstract class Relation |
|
60 | -{ |
|
59 | +abstract class Relation { |
|
61 | 60 | /** |
62 | 61 | * Query callback |
63 | 62 | * @var callable|null |
@@ -53,15 +53,13 @@ |
||
53 | 53 | * @package Platine\Orm\Relation |
54 | 54 | * @template TEntity as \Platine\Orm\Entity |
55 | 55 | */ |
56 | -class RelationFactory |
|
57 | -{ |
|
56 | +class RelationFactory { |
|
58 | 57 | /** |
59 | 58 | * Create new instance |
60 | 59 | * @param string $name |
61 | 60 | * @param Closure $callback |
62 | 61 | */ |
63 | - public function __construct(protected string $name, protected Closure $callback) |
|
64 | - { |
|
62 | + public function __construct(protected string $name, protected Closure $callback) { |
|
65 | 63 | } |
66 | 64 | |
67 | 65 | /** |
@@ -168,7 +168,7 @@ |
||
168 | 168 | * |
169 | 169 | * @return TEntity|array<TEntity>|null |
170 | 170 | */ |
171 | - public function getResult(DataMapper $mapper, ?callable $callback = null): Entity|array|null |
|
171 | + public function getResult(DataMapper $mapper, ?callable $callback = null): Entity | array | null |
|
172 | 172 | { |
173 | 173 | $manager = $mapper->getEntityManager(); |
174 | 174 | $owner = $mapper->getEntityMapper(); |
@@ -61,8 +61,7 @@ |
||
61 | 61 | * @template TEntity as Entity |
62 | 62 | * @extends Relation<TEntity> |
63 | 63 | */ |
64 | -abstract class HasRelation extends Relation |
|
65 | -{ |
|
64 | +abstract class HasRelation extends Relation { |
|
66 | 65 | /** |
67 | 66 | * Whether is many or not |
68 | 67 | * @var bool |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @package Platine\Orm\Relation |
57 | 57 | * @template TEntity as Entity |
58 | 58 | */ |
59 | -class PrimaryKey implements Stringable |
|
60 | -{ |
|
59 | +class PrimaryKey implements Stringable { |
|
61 | 60 | /** |
62 | 61 | * |
63 | 62 | * @var array<int, string> |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | * Create new instance |
75 | 74 | * @param string ...$columns |
76 | 75 | */ |
77 | - public function __construct(string ...$columns) |
|
78 | - { |
|
76 | + public function __construct(string ...$columns) { |
|
79 | 77 | $this->columns = array_values($columns); |
80 | 78 | $this->composite = count($columns) > 1; |
81 | 79 | } |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | * @class ForeignKey |
53 | 53 | * @package Platine\Orm\Relation |
54 | 54 | */ |
55 | -class ForeignKey implements Stringable |
|
56 | -{ |
|
55 | +class ForeignKey implements Stringable { |
|
57 | 56 | /** |
58 | 57 | * |
59 | 58 | * @var array<string, string> |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * Create new instance |
71 | 70 | * @param array<string, string> $columns |
72 | 71 | */ |
73 | - public function __construct(array $columns) |
|
74 | - { |
|
72 | + public function __construct(array $columns) { |
|
75 | 73 | $this->columns = $columns; |
76 | 74 | $this->composite = count($columns) > 1; |
77 | 75 | } |
@@ -50,15 +50,13 @@ |
||
50 | 50 | * @class Junction |
51 | 51 | * @package Platine\Orm\Relation |
52 | 52 | */ |
53 | -class Junction |
|
54 | -{ |
|
53 | +class Junction { |
|
55 | 54 | /** |
56 | 55 | * Create new instance |
57 | 56 | * @param string $table |
58 | 57 | * @param array<string, string> $columns |
59 | 58 | */ |
60 | - public function __construct(protected string $table, protected array $columns) |
|
61 | - { |
|
59 | + public function __construct(protected string $table, protected array $columns) { |
|
62 | 60 | } |
63 | 61 | |
64 | 62 | /** |