@@ -4,11 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Daikon\Entity\Assert\Assertion; |
| 6 | 6 | use Daikon\Entity\EntityType\EntityTypeInterface; |
| 7 | -use Daikon\Entity\Entity\Path\ValuePath; |
|
| 8 | 7 | use Daikon\Entity\Entity\Path\ValuePathParser; |
| 9 | -use Daikon\Entity\Entity\Path\ValuePathPart; |
|
| 10 | 8 | use Daikon\Entity\Error\UnknownAttribute; |
| 11 | -use Daikon\Entity\ValueObject\NestedEntityList; |
|
| 12 | 9 | use Daikon\Entity\ValueObject\ValueObjectInterface; |
| 13 | 10 | |
| 14 | 11 | abstract class Entity implements TypedEntityInterface |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | return $this->type; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - /** |
|
| 144 | + /** |
|
| 145 | 145 | * {@inheritdoc} |
| 146 | 146 | */ |
| 147 | 147 | public function toArray(): array |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | /** |
| 129 | 129 | * {@inheritdoc} |
| 130 | 130 | */ |
| 131 | - public function getEntityParent(): ?TypedEntityInterface |
|
| 131 | + public function getEntityParent(): ? TypedEntityInterface |
|
| 132 | 132 | { |
| 133 | 133 | return $this->parent; |
| 134 | 134 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Daikon\Entity\Entity; |
| 4 | 4 | |
| 5 | 5 | use Daikon\Entity\Assert\Assertion; |
| 6 | -use Daikon\Entity\Error\InvalidType; |
|
| 7 | 6 | use Daikon\Entity\ValueObject\Nil; |
| 8 | 7 | use Daikon\Entity\ValueObject\ValueObjectInterface; |
| 9 | 8 | |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Daikon\DataStructures\TypedListTrait; |
| 6 | 6 | use Daikon\Entity\Assert\Assertion; |
| 7 | -use Daikon\Entity\Error\InvalidType; |
|
| 8 | 7 | use Daikon\Entity\ValueObject\ValueObjectInterface; |
| 9 | 8 | use Daikon\Entity\ValueObject\ValueObjectListInterface; |
| 10 | 9 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function toNative(): array |
| 79 | 79 | { |
| 80 | - return $this->compositeVector->map(static function (ValueObjectInterface $entity): array { |
|
| 80 | + return $this->compositeVector->map(static function(ValueObjectInterface $entity): array { |
|
| 81 | 81 | return $entity->toNative(); |
| 82 | 82 | })->toArray(); |
| 83 | 83 | } |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Daikon\Entity\EntityType; |
| 4 | 4 | |
| 5 | -use Daikon\Entity\EntityType\Path\TypePath; |
|
| 6 | -use Daikon\Entity\EntityType\Path\TypePathPart; |
|
| 7 | 5 | use Daikon\Entity\Entity\EntityInterface; |
| 8 | 6 | use Daikon\Entity\Error\InvalidType; |
| 9 | 7 | use Daikon\Entity\Error\MissingImplementation; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Daikon\Entity\EntityType; |
| 4 | 4 | |
| 5 | -use Ds\Vector; |
|
| 6 | 5 | use Daikon\Entity\Assert\Assert; |
| 7 | 6 | use Daikon\Entity\Assert\Assertion; |
| 8 | 7 | use Daikon\Entity\EntityType\EntityTypeMap; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $this->name = $name; |
| 72 | 72 | $this->entityType = $entityType; |
| 73 | - $this->allowedTypes = new EntityTypeMap(array_map(function (string $typeFqcn) { |
|
| 73 | + $this->allowedTypes = new EntityTypeMap(array_map(function(string $typeFqcn) { |
|
| 74 | 74 | if (!class_exists($typeFqcn)) { |
| 75 | 75 | throw new MissingImplementation("Unable to load given entity-type class: '$typeFqcn'"); |
| 76 | 76 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * @param array $values |
| 31 | 31 | * @param TypedEntityInterface $parentEntity |
| 32 | - * @return Vector |
|
| 32 | + * @return NestedEntityList |
|
| 33 | 33 | */ |
| 34 | 34 | private function makeEntityList(array $values, TypedEntityInterface $parentEntity = null): NestedEntityList |
| 35 | 35 | { |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Daikon\Entity\EntityType; |
| 4 | 4 | |
| 5 | 5 | use Daikon\Entity\Assert\Assert; |
| 6 | -use Daikon\Entity\Assert\Assertion; |
|
| 7 | 6 | use Daikon\Entity\Entity\EntityInterface; |
| 8 | 7 | use Daikon\Entity\Entity\NestedEntityList; |
| 9 | 8 | use Daikon\Entity\Entity\TypedEntityInterface; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | private function makeEntityList(array $values, TypedEntityInterface $parentEntity = null): NestedEntityList |
| 35 | 35 | { |
| 36 | 36 | return new NestedEntityList( |
| 37 | - array_map(function (array $entityValues) use ($parentEntity) { |
|
| 37 | + array_map(function(array $entityValues) use ($parentEntity) { |
|
| 38 | 38 | return parent::makeValue($entityValues, $parentEntity); |
| 39 | 39 | }, $values) |
| 40 | 40 | ); |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | * Returns the type"s parent-attribute, if it has one. |
| 31 | 31 | * @return null|AttributeInterface |
| 32 | 32 | */ |
| 33 | - public function getParentAttribute(): ?AttributeInterface; |
|
| 33 | + public function getParentAttribute(): ? AttributeInterface; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Returns the type"s parent-type, if it has one. |
| 37 | 37 | * @return null|EntityTypeInterface |
| 38 | 38 | */ |
| 39 | - public function getParent(): ?EntityTypeInterface; |
|
| 39 | + public function getParent(): ? EntityTypeInterface; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Tells if an entity-type has a parent-type, hence is a nested-type. |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function __construct(array $attributes = []) |
| 15 | 15 | { |
| 16 | - $this->init(array_reduce($attributes, function (array $carry, AttributeInterface $attribute) { |
|
| 16 | + $this->init(array_reduce($attributes, function(array $carry, AttributeInterface $attribute) { |
|
| 17 | 17 | $carry[$attribute->getName()] = $attribute; // enforce consistent attribute keys |
| 18 | 18 | return $carry; |
| 19 | 19 | }, []), AttributeInterface::class); |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | public function byClassNames(array $classNames = []): self |
| 28 | 28 | { |
| 29 | 29 | $clonedMap = clone $this; |
| 30 | - (function (string ...$classNames) use ($clonedMap): void { |
|
| 30 | + (function(string ...$classNames) use ($clonedMap): void { |
|
| 31 | 31 | $clonedMap->compositeMap = $clonedMap->compositeMap->filter( |
| 32 | - function (string $name, AttributeInterface $attribute) use ($classNames): bool { |
|
| 32 | + function(string $name, AttributeInterface $attribute) use ($classNames): bool { |
|
| 33 | 33 | return in_array(get_class($attribute), $classNames); |
| 34 | 34 | } |
| 35 | 35 | ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * {@inheritdoc} |
| 81 | 81 | */ |
| 82 | - public function getParentAttribute(): ?AttributeInterface |
|
| 82 | + public function getParentAttribute(): ? AttributeInterface |
|
| 83 | 83 | { |
| 84 | 84 | return $this->parentAttribute; |
| 85 | 85 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * {@inheritdoc} |
| 89 | 89 | */ |
| 90 | - public function getParent(): ?EntityTypeInterface |
|
| 90 | + public function getParent(): ? EntityTypeInterface |
|
| 91 | 91 | { |
| 92 | 92 | return $this->hasParent() ? $this->getParentAttribute()->getEntityType() : null; |
| 93 | 93 | } |