Completed
Branch master (e6520e)
by Thorsten
02:09
created
src/Entity/Entity.php 3 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -4,11 +4,8 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
         return $this->type;
142 142
     }
143 143
 
144
-   /**
144
+    /**
145 145
      * {@inheritdoc}
146 146
      */
147 147
     public function toArray(): array
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Entity/NestedEntity.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Entity/NestedEntityList.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/EntityType/Attribute.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/EntityType/NestedEntityAttribute.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/EntityType/NestedEntityListAttribute.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
src/EntityType/EntityTypeInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
src/EntityType/AttributeMap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             );
Please login to merge, or discard this patch.
src/EntityType/EntityType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.