Passed
Branch 10.0.x (3960e7)
by Tom
03:00
created
Category
src/Metadata/MetadataFactory.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             // Only one matching instance per group is allowed
97 97
             assert(
98
-                ! $entityInstance,
98
+                !$entityInstance,
99 99
                 'Duplicate attribute found for entity '
100 100
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
101 101
             );
@@ -112,8 +112,7 @@  discard block
 block discarded – undo
112 112
                 'excludeFilters' => Filters::toStringArray($instance->getExcludeFilters()),
113 113
                 'description' => $instance->getDescription(),
114 114
                 'typeName' => $instance->getTypeName()
115
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
116
-                    $this->getTypeName($reflectionClass->getName()),
115
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
117 116
             ];
118 117
         }
119 118
     }
@@ -139,7 +138,7 @@  discard block
 block discarded – undo
139 138
 
140 139
                 // Only one matching instance per group is allowed
141 140
                 assert(
142
-                    ! $fieldInstance,
141
+                    !$fieldInstance,
143 142
                     'Duplicate attribute found for field '
144 143
                     . $fieldName . ', group ' . $instance->getGroup(),
145 144
                 );
@@ -184,7 +183,7 @@  discard block
 block discarded – undo
184 183
 
185 184
                 // Only one matching instance per group is allowed
186 185
                 assert(
187
-                    ! $associationInstance,
186
+                    !$associationInstance,
188 187
                     'Duplicate attribute found for association '
189 188
                     . $associationName . ', group ' . $instance->getGroup(),
190 189
                 );
Please login to merge, or discard this patch.
src/Filter/Filters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     public static function fromArray(array $filters): array
89 89
     {
90 90
         $filters = array_map(
91
-            static function ($filter) {
91
+            static function($filter) {
92 92
                 return is_string($filter) ? Filters::from($filter) : $filter;
93 93
             },
94 94
             $filters,
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public static function toStringArray(array $filters): array
108 108
     {
109 109
         return array_map(
110
-            static function (Filters $filter) {
110
+            static function(Filters $filter) {
111 111
                 return $filter->value;
112 112
             },
113 113
             $filters,
Please login to merge, or discard this patch.
src/Attribute/ExcludeFilters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $this->excludeFilters = array_udiff(
35 35
                 Filters::cases(),
36 36
                 $this->includeFilters,
37
-                static function (Filters $a1, Filters $a2) {
37
+                static function(Filters $a1, Filters $a2) {
38 38
                     return $a1->value <=> $a2->value;
39 39
                 },
40 40
             );
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->excludeFilters = array_uintersect(
43 43
                 Filters::cases(),
44 44
                 $this->excludeFilters,
45
-                static function (Filters $a1, Filters $a2) {
45
+                static function(Filters $a1, Filters $a2) {
46 46
                     return $a1->value <=> $a2->value;
47 47
                 },
48 48
             );
Please login to merge, or discard this patch.
src/Input/InputFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $fields       = [];
46 46
         $targetEntity = $this->entityTypeManager->get($id);
47 47
 
48
-        if (! count($requiredFields) && ! count($optionalFields)) {
48
+        if (!count($requiredFields) && !count($optionalFields)) {
49 49
             $this->addAllFieldsAsRequired($targetEntity, $fields);
50 50
         } else {
51 51
             $this->addRequiredFields($targetEntity, $requiredFields, $fields);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         array &$fields,
70 70
     ): void {
71 71
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
72
-            if (! in_array($fieldName, $optionalFields)) {
72
+            if (!in_array($fieldName, $optionalFields)) {
73 73
                 continue;
74 74
             }
75 75
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         array &$fields,
103 103
     ): void {
104 104
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
105
-            if (! in_array($fieldName, $requiredFields)) {
105
+            if (!in_array($fieldName, $requiredFields)) {
106 106
                 continue;
107 107
             }
108 108
 
Please login to merge, or discard this patch.
src/Services.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
             ->set(EntityManager::class, $entityManager)
29 29
             ->set(
30 30
                 Config::class,
31
-                static function () use ($config) {
32
-                    if (! $config) {
31
+                static function() use ($config) {
32
+                    if (!$config) {
33 33
                         $config = new Config();
34 34
                     }
35 35
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             )
51 51
             ->set(
52 52
                 'metadata',
53
-                static function (AbstractContainer $container) use ($metadata) {
53
+                static function(AbstractContainer $container) use ($metadata) {
54 54
                     return (new Metadata\MetadataFactory(
55 55
                         $metadata,
56 56
                         $container->get(EntityManager::class),
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             )
63 63
             ->set(
64 64
                 Metadata\GlobalEnable::class,
65
-                static function (AbstractContainer $container) {
65
+                static function(AbstractContainer $container) {
66 66
                     return new Metadata\GlobalEnable(
67 67
                         $container->get(EntityManager::class),
68 68
                         $container->get(Config::class),
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             )
73 73
             ->set(
74 74
                 Resolve\FieldResolver::class,
75
-                static function (AbstractContainer $container) {
75
+                static function(AbstractContainer $container) {
76 76
                     return new Resolve\FieldResolver(
77 77
                         $container->get(Config::class),
78 78
                         $container->get(Type\Entity\EntityTypeManager::class),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             )
82 82
             ->set(
83 83
                 Resolve\ResolveCollectionFactory::class,
84
-                static function (AbstractContainer $container) {
84
+                static function(AbstractContainer $container) {
85 85
                     return new Resolve\ResolveCollectionFactory(
86 86
                         $container->get(EntityManager::class),
87 87
                         $container->get(Config::class),
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             )
95 95
             ->set(
96 96
                 Resolve\ResolveEntityFactory::class,
97
-                static function (AbstractContainer $container) {
97
+                static function(AbstractContainer $container) {
98 98
                     return new Resolve\ResolveEntityFactory(
99 99
                         $container->get(Config::class),
100 100
                         $container->get(EntityManager::class),
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             )
106 106
             ->set(
107 107
                 Filter\FilterFactory::class,
108
-                static function (AbstractContainer $container) {
108
+                static function(AbstractContainer $container) {
109 109
                     return new Filter\FilterFactory(
110 110
                         $container->get(Config::class),
111 111
                         $container->get(EntityManager::class),
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             )
117 117
             ->set(
118 118
                 Hydrator\HydratorFactory::class,
119
-                static function (AbstractContainer $container) {
119
+                static function(AbstractContainer $container) {
120 120
                     return new Hydrator\HydratorFactory(
121 121
                         $container->get(EntityManager::class),
122 122
                         $container->get(Type\Entity\EntityTypeManager::class),
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             )
126 126
             ->set(
127 127
                 Input\InputFactory::class,
128
-                static function (AbstractContainer $container) {
128
+                static function(AbstractContainer $container) {
129 129
                     return new Input\InputFactory(
130 130
                         $container->get(Config::class),
131 131
                         $container->get(EntityManager::class),
Please login to merge, or discard this patch.
src/Filter/FilterFactory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
         );
73 73
 
74 74
         // Get the allowed filters
75
-        $allowedFilters = array_udiff(Filters::cases(), $excludedFilters, static function ($a, $b) {
75
+        $allowedFilters = array_udiff(Filters::cases(), $excludedFilters, static function($a, $b) {
76 76
             return $a->value <=> $b->value;
77 77
         });
78 78
 
79 79
         // Limit association filters
80 80
         if ($associationName) {
81 81
             $excludeFilters = Filters::fromArray($associationMetadata['excludeFilters'] ?? []);
82
-            $allowedFilters = array_filter($allowedFilters, static function ($value) use ($excludeFilters) {
83
-                return ! in_array($value, $excludeFilters);
82
+            $allowedFilters = array_filter($allowedFilters, static function($value) use ($excludeFilters) {
83
+                return !in_array($value, $excludeFilters);
84 84
             });
85 85
         }
86 86
 
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
 
115 115
         foreach ($classMetadata->getFieldNames() as $fieldName) {
116 116
             // Only process fields that are in the graphql metadata
117
-            if (! in_array($fieldName, array_keys($entityMetadata['fields']))) {
117
+            if (!in_array($fieldName, array_keys($entityMetadata['fields']))) {
118 118
                 continue;
119 119
             }
120 120
 
121 121
             $graphQLType = $this->typeManager
122 122
                 ->get($entityMetadata['fields'][$fieldName]['type']);
123 123
 
124
-            if (! $graphQLType instanceof ScalarType) {
124
+            if (!$graphQLType instanceof ScalarType) {
125 125
                 continue;
126 126
             }
127 127
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
                 $fieldExcludeFilters = Filters::fromArray($entityMetadata['fields'][$fieldName]['excludeFilters']);
134 134
                 $allowedFilters      = array_filter(
135 135
                     $allowedFilters,
136
-                    static function ($value) use ($fieldExcludeFilters) {
137
-                        return ! in_array($value, $fieldExcludeFilters);
136
+                    static function($value) use ($fieldExcludeFilters) {
137
+                        return !in_array($value, $fieldExcludeFilters);
138 138
                     },
139 139
                 );
140 140
             }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         // Add eq filter for to-one associations
179 179
         foreach ($classMetadata->getAssociationNames() as $associationName) {
180 180
             // Only process fields which are in the graphql metadata
181
-            if (! isset($entityMetadata['fields'][$associationName])) {
181
+            if (!isset($entityMetadata['fields'][$associationName])) {
182 182
                 continue;
183 183
             }
184 184
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                     ClassMetadata::MANY_TO_MANY,
191 191
                     ClassMetadata::ONE_TO_MANY,
192 192
                 ])
193
-                || ! in_array(Filters::EQ, $allowedFilters)
193
+                || !in_array(Filters::EQ, $allowedFilters)
194 194
             ) {
195 195
                 continue;
196 196
             }
Please login to merge, or discard this patch.
src/Filter/InputObjectType/Field.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@
 block discarded – undo
39 39
             ];
40 40
 
41 41
             // @codeCoverageIgnoreStart
42
-            if (! $type instanceof ScalarType) {
42
+            if (!$type instanceof ScalarType) {
43 43
                 continue;
44 44
             }
45 45
 
46 46
             // @codeCoverageIgnoreEnd
47 47
 
48
-            if (! ($fields[$filter->value]['type'] instanceof Between)) {
48
+            if (!($fields[$filter->value]['type'] instanceof Between)) {
49 49
                 continue;
50 50
             }
51 51
 
Please login to merge, or discard this patch.
src/Type/Entity/Entity.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->hydratorFactory   = $container->get(HydratorFactory::class);
66 66
         $this->typeManager       = $container->get(TypeManager::class);
67 67
 
68
-        if (! isset($container->get('metadata')[$typeName])) {
68
+        if (!isset($container->get('metadata')[$typeName])) {
69 69
             throw new Error(
70 70
                 'Entity ' . $typeName . ' is not mapped in the metadata',
71 71
             );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
157 157
 
158 158
         foreach ($classMetadata->getFieldNames() as $fieldName) {
159
-            if (! in_array($fieldName, array_keys($this->metadata['fields']))) {
159
+            if (!in_array($fieldName, array_keys($this->metadata['fields']))) {
160 160
                 continue;
161 161
             }
162 162
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
175 175
 
176 176
         foreach ($classMetadata->getAssociationNames() as $associationName) {
177
-            if (! in_array($associationName, array_keys($this->metadata['fields']))) {
177
+            if (!in_array($associationName, array_keys($this->metadata['fields']))) {
178 178
                 continue;
179 179
             }
180 180
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 ])
188 188
             ) {
189 189
                 $targetEntity             = $associationMetadata['targetEntity'];
190
-                $fields[$associationName] = function () use ($targetEntity) {
190
+                $fields[$associationName] = function() use ($targetEntity) {
191 191
                     $entity = $this->entityTypeManager->get($targetEntity);
192 192
 
193 193
                     return [
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
             // Collections
203 203
             $targetEntity             = $associationMetadata['targetEntity'];
204
-            $fields[$associationName] = function () use ($targetEntity, $associationName) {
204
+            $fields[$associationName] = function() use ($targetEntity, $associationName) {
205 205
                 $entity    = $this->entityTypeManager->get($targetEntity);
206 206
                 $shortName = $this->getTypeName() . '_' . ucwords($associationName);
207 207
 
Please login to merge, or discard this patch.