Completed
Branch master (e6520e)
by Thorsten
02:09
created
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.
src/EntityType/NestedEntityListAttribute.php 1 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/EntityTypeMap.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 $entityTypes = [])
15 15
     {
16
-        $this->init(array_reduce($entityTypes, function (array $carry, EntityTypeInterface $entityType) {
16
+        $this->init(array_reduce($entityTypes, function(array $carry, EntityTypeInterface $entityType) {
17 17
             $carry[$entityType->getPrefix()] = $entityType; // enforce consistent attribute keys
18 18
             return $carry;
19 19
         }, []), EntityTypeInterface::class);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @param string $name
24 24
      * @return null|EntityTypeInterface
25 25
      */
26
-    public function byName(string $name): ?EntityTypeInterface
26
+    public function byName(string $name): ? EntityTypeInterface
27 27
     {
28 28
         foreach ($this as $type) {
29 29
             if ($type->getName() === $name) {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param string $className
38 38
      * @return null|EntityTypeInterface
39 39
      */
40
-    public function byClassName(string $className): ?EntityTypeInterface
40
+    public function byClassName(string $className): ? EntityTypeInterface
41 41
     {
42 42
         foreach ($this as $type) {
43 43
             if (get_class($type) === $className) {
Please login to merge, or discard this patch.
src/EntityType/Path/TypePath.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $currentAttribute = $attribute->getParent();
25 25
         $currentType = $attribute->getEntityType();
26 26
         $pathLeaf = new TypePathPart($attribute->getName());
27
-        $typePath = new TypePath([ $pathLeaf ]);
27
+        $typePath = new TypePath([$pathLeaf]);
28 28
         while ($currentAttribute) {
29 29
             $pathPart = new TypePathPart($currentAttribute->getName(), $currentType->getPrefix());
30 30
             $typePath = $typePath->push($pathPart);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function __construct(iterable $pathParts = null)
43 43
     {
44 44
         $this->internalVector = new Vector(
45
-            (function (TypePathPart ...$pathParts): array {
45
+            (function(TypePathPart ...$pathParts): array {
46 46
                 return $pathParts;
47 47
             })(...$pathParts ?? [])
48 48
         );
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function __toString(): string
92 92
     {
93
-        $flattenPath = function (string $path, TypePathPart $pathPart): string {
93
+        $flattenPath = function(string $path, TypePathPart $pathPart): string {
94 94
             return empty($path) ? (string)$pathPart : "$path-$pathPart";
95 95
         };
96 96
         return $this->internalVector->reduce($flattenPath, "");
Please login to merge, or discard this patch.
src/EntityType/Path/TypePathParser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public static function create(): TypePathParser
43 43
     {
44
-        $mapToken = function (string $token): array {
44
+        $mapToken = function(string $token): array {
45 45
             switch ($token) {
46 46
                 case ".":
47
-                    return [ self::T_COMPONENT_SEP, $token ];
47
+                    return [self::T_COMPONENT_SEP, $token];
48 48
                 case "-":
49
-                    return [ self::T_PART_SEP, $token ];
49
+                    return [self::T_PART_SEP, $token];
50 50
                 default:
51 51
                     return preg_match("/[a-z_]+/", $token)
52
-                        ? [ self::T_TYPE, $token ]
53
-                        : [ self::T_UNKNOWN, $token ];
52
+                        ? [self::T_TYPE, $token]
53
+                        : [self::T_UNKNOWN, $token];
54 54
             }
55 55
         };
56 56
         $lexer = new SimpleLexer(self::TOKEN_REGEX, self::TOKEN_MAP, $mapToken);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     /**
83 83
      * @return null|TypePathPart
84 84
      */
85
-    private function consumePathPart(): ?TypePathPart
85
+    private function consumePathPart(): ? TypePathPart
86 86
     {
87 87
         if ($this->lexer->isNext(self::T_PART_SEP)) {
88 88
             $this->match(self::T_PART_SEP);
Please login to merge, or discard this patch.
src/EntityType/AttributeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     /**
37 37
      * {@inheritdoc}
38 38
      */
39
-    public function getParent(): ?AttributeInterface
39
+    public function getParent(): ? AttributeInterface
40 40
     {
41 41
         return $this->getEntityType()->getParentAttribute();
42 42
     }
Please login to merge, or discard this patch.
src/EntityType/AttributeInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      * Returns the attribute"s parent, if it has one.
45 45
      * @return null|AttributeInterface
46 46
      */
47
-    public function getParent(): ?AttributeInterface;
47
+    public function getParent(): ? AttributeInterface;
48 48
 
49 49
     /**
50 50
      * Return information reflecting the attribute's value e.g. VO class or allowed nested-types
Please login to merge, or discard this patch.