@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * @package Platine\Orm |
| 56 | 56 | * @template TEntity as Entity |
| 57 | 57 | */ |
| 58 | -interface RepositoryInterface |
|
| 59 | -{ |
|
| 58 | +interface RepositoryInterface { |
|
| 60 | 59 | /** |
| 61 | 60 | * Return the instance of EntityQuery |
| 62 | 61 | * @param string|array<int, string>|array<string, Closure> $with |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @package Platine\Orm\Relation |
| 56 | 56 | * @template TEntity as \Platine\Orm\Entity |
| 57 | 57 | */ |
| 58 | -abstract class Relation |
|
| 59 | -{ |
|
| 58 | +abstract class Relation { |
|
| 60 | 59 | /** |
| 61 | 60 | * Query callback |
| 62 | 61 | * @var callable|null |
@@ -80,8 +79,7 @@ discard block |
||
| 80 | 79 | * @param class-string<TEntity> $entityClass |
| 81 | 80 | * @param ForeignKey|null $foreignKey |
| 82 | 81 | */ |
| 83 | - public function __construct(string $entityClass, ?ForeignKey $foreignKey = null) |
|
| 84 | - { |
|
| 82 | + public function __construct(string $entityClass, ?ForeignKey $foreignKey = null) { |
|
| 85 | 83 | $this->entityClass = $entityClass; |
| 86 | 84 | $this->foreignKey = $foreignKey; |
| 87 | 85 | } |
@@ -61,8 +61,7 @@ discard block |
||
| 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 |
@@ -161,8 +160,7 @@ discard block |
||
| 161 | 160 | * {@inheritedoc} |
| 162 | 161 | * @param DataMapper<TEntity> $mapper |
| 163 | 162 | */ |
| 164 | - public function getResult(DataMapper $mapper, ?callable $callback = null) |
|
| 165 | - { |
|
| 163 | + public function getResult(DataMapper $mapper, ?callable $callback = null) { |
|
| 166 | 164 | $manager = $mapper->getEntityManager(); |
| 167 | 165 | $owner = $mapper->getEntityMapper(); |
| 168 | 166 | $related = $manager->getEntityMapper($this->entityClass); |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @template TEntity as \Platine\Orm\Entity |
| 53 | 53 | * @extends ShareRelation<TEntity> |
| 54 | 54 | */ |
| 55 | -class ShareOne extends ShareRelation |
|
| 56 | -{ |
|
| 55 | +class ShareOne extends ShareRelation { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritedoc} |
| 59 | 58 | */ |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * @package Platine\Orm\Relation |
| 56 | 56 | * @template TEntity as \Platine\Orm\Entity |
| 57 | 57 | */ |
| 58 | -class RelationLoader |
|
| 59 | -{ |
|
| 58 | +class RelationLoader { |
|
| 60 | 59 | /** |
| 61 | 60 | * |
| 62 | 61 | * @var EntityQuery<TEntity> |
@@ -123,8 +122,7 @@ discard block |
||
| 123 | 122 | * @param DataMapper<TEntity> $mapper |
| 124 | 123 | * @return null|TEntity|TEntity[] |
| 125 | 124 | */ |
| 126 | - public function getResult(DataMapper $mapper) |
|
| 127 | - { |
|
| 125 | + public function getResult(DataMapper $mapper) { |
|
| 128 | 126 | $results = $this->loadResults(); |
| 129 | 127 | |
| 130 | 128 | if ($this->inverse) { |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @template TEntity as \Platine\Orm\Entity |
| 53 | 53 | * @extends HasRelation<TEntity> |
| 54 | 54 | */ |
| 55 | -class HasOne extends HasRelation |
|
| 56 | -{ |
|
| 55 | +class HasOne extends HasRelation { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritedoc} |
| 59 | 58 | */ |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @template TEntity as \Platine\Orm\Entity |
| 53 | 53 | * @extends HasRelation<TEntity> |
| 54 | 54 | */ |
| 55 | -class HasMany extends HasRelation |
|
| 56 | -{ |
|
| 55 | +class HasMany extends HasRelation { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritedoc} |
| 59 | 58 | */ |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @template TEntity as \Platine\Orm\Entity |
| 53 | 53 | * @extends ShareRelation<TEntity> |
| 54 | 54 | */ |
| 55 | -class ShareMany extends ShareRelation |
|
| 56 | -{ |
|
| 55 | +class ShareMany extends ShareRelation { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritedoc} |
| 59 | 58 | */ |
@@ -53,8 +53,7 @@ discard block |
||
| 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 | * The relation name |
| 60 | 59 | * @var string |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | * @param string $name |
| 73 | 72 | * @param Closure $callback |
| 74 | 73 | */ |
| 75 | - public function __construct(string $name, Closure $callback) |
|
| 76 | - { |
|
| 74 | + public function __construct(string $name, Closure $callback) { |
|
| 77 | 75 | $this->name = $name; |
| 78 | 76 | $this->callback = $callback; |
| 79 | 77 | } |