Passed
Pull Request — main (#94)
by Tom
02:57
created
src/Resolve/ResolveCollectionFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     public function get(Entity $entity): Closure
54 54
     {
55
-        return function ($source, $args, $context, ResolveInfo $resolveInfo) {
55
+        return function($source, $args, $context, ResolveInfo $resolveInfo) {
56 56
             $fieldResolver = $this->fieldResolver;
57 57
             $collection    = $fieldResolver($source, $args, $context, $resolveInfo);
58 58
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             }
126 126
         }
127 127
 
128
-        if (! empty($orderBy)) {
128
+        if (!empty($orderBy)) {
129 129
             $criteria->orderBy($orderBy);
130 130
         }
131 131
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         // Get total count from collection then match
184 184
         $itemCount = count($collection->matching($criteria));
185 185
 
186
-        if ($last && ! $before) {
186
+        if ($last && !$before) {
187 187
             $offset = $itemCount - $last;
188 188
         }
189 189
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             ];
212 212
 
213 213
             $lastCursor = $cursor;
214
-            if (! $firstCursor) {
214
+            if (!$firstCursor) {
215 215
                 $firstCursor = $cursor;
216 216
             }
217 217
 
Please login to merge, or discard this patch.
src/Resolve/ResolveEntityFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function get(Entity $entity, string $eventName): Closure
34 34
     {
35
-        return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
35
+        return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
36 36
             $entityClass = $entity->getEntityClass();
37 37
 
38 38
             $queryBuilderFilter = (new Applicator($this->entityManager, $entityClass))
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         $paginator = new Paginator($queryBuilder->getQuery());
192 192
         $itemCount = $paginator->count();
193 193
 
194
-        if ($last && ! $before) {
194
+        if ($last && !$before) {
195 195
             $offset = $itemCount - $last;
196 196
             $queryBuilder->setFirstResult($offset);
197 197
             $paginator = new Paginator($queryBuilder->getQuery());
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             ];
211 211
 
212 212
             $lastCursor = $cursor;
213
-            if (! $firstCursor) {
213
+            if (!$firstCursor) {
214 214
                 $firstCursor = $cursor;
215 215
             }
216 216
 
Please login to merge, or discard this patch.
src/Metadata/MetadataFactory.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
 
23 23
 class MetadataFactory
24 24
 {
25
-    protected Metadata|null $metadata = null;
25
+    protected Metadata | null $metadata = null;
26 26
     protected EntityManager $entityManager;
27 27
     protected Config $config;
28 28
 
29 29
     /** @param mixed|null $metadataConfig */
30
-    public function __construct(protected ContainerInterface $container, protected array|null $metadataConfig)
30
+    public function __construct(protected ContainerInterface $container, protected array | null $metadataConfig)
31 31
     {
32 32
         $this->entityManager = $container->get(EntityManager::class);
33 33
         $this->config        = $container->get(Config::class);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
             // Only one matching instance per group is allowed
160 160
             assert(
161
-                ! $entityInstance,
161
+                !$entityInstance,
162 162
                 'Duplicate attribute found for entity '
163 163
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
164 164
             );
@@ -174,8 +174,7 @@  discard block
 block discarded – undo
174 174
                 'excludeCriteria' => $instance->getExcludeCriteria(),
175 175
                 'description' => $instance->getDescription(),
176 176
                 'typeName' => $instance->getTypeName()
177
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
178
-                    $this->getTypeName($reflectionClass->getName()),
177
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
179 178
             ];
180 179
         }
181 180
     }
@@ -198,7 +197,7 @@  discard block
 block discarded – undo
198 197
 
199 198
                 // Only one matching instance per group is allowed
200 199
                 assert(
201
-                    ! $fieldInstance,
200
+                    !$fieldInstance,
202 201
                     'Duplicate attribute found for field '
203 202
                     . $fieldName . ', group ' . $instance->getGroup(),
204 203
                 );
@@ -246,7 +245,7 @@  discard block
 block discarded – undo
246 245
 
247 246
                 // Only one matching instance per group is allowed
248 247
                 assert(
249
-                    ! $associationInstance,
248
+                    !$associationInstance,
250 249
                     'Duplicate attribute found for association '
251 250
                     . $associationName . ', group ' . $instance->getGroup(),
252 251
                 );
@@ -316,7 +315,7 @@  discard block
 block discarded – undo
316 315
         return $this->appendGroupSuffix($this->stripEntityPrefix($entityClass));
317 316
     }
318 317
 
319
-    private function getDefaultStrategy(string|null $fieldType): string
318
+    private function getDefaultStrategy(string | null $fieldType): string
320 319
     {
321 320
         // Set default strategy based on field type
322 321
         switch ($fieldType) {
Please login to merge, or discard this patch.
src/Criteria/CriteriaFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     /** @param mixed[]|null $associationMetadata */
33 33
     public function get(
34 34
         Entity $targetEntity,
35
-        Entity|null $owningEntity = null,
36
-        string|null $associationName = null,
37
-        array|null $associationMetadata = null,
35
+        Entity | null $owningEntity = null,
36
+        string | null $associationName = null,
37
+        array | null $associationMetadata = null,
38 38
     ): InputObjectType {
39 39
         if ($owningEntity) {
40 40
             $typeName = $owningEntity->getTypeName() . '_' . $associationName . '_filter';
@@ -55,16 +55,16 @@  discard block
 block discarded – undo
55 55
         // Limit entity filters
56 56
         if ($entityMetadata['excludeCriteria']) {
57 57
             $excludeCriteria = $entityMetadata['excludeCriteria'];
58
-            $allowedFilters  = array_filter($allowedFilters, static function ($value) use ($excludeCriteria) {
59
-                return ! in_array($value, $excludeCriteria);
58
+            $allowedFilters  = array_filter($allowedFilters, static function($value) use ($excludeCriteria) {
59
+                return !in_array($value, $excludeCriteria);
60 60
             });
61 61
         }
62 62
 
63 63
         // Limit association filters
64 64
         if ($associationName) {
65 65
             $excludeCriteria = $associationMetadata['excludeCriteria'];
66
-            $allowedFilters  = array_filter($allowedFilters, static function ($value) use ($excludeCriteria) {
67
-                return ! in_array($value, $excludeCriteria);
66
+            $allowedFilters  = array_filter($allowedFilters, static function($value) use ($excludeCriteria) {
67
+                return !in_array($value, $excludeCriteria);
68 68
             });
69 69
         }
70 70
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $graphQLType = null;
73 73
 
74 74
             // Only process fields which are in the graphql metadata
75
-            if (! in_array($fieldName, array_keys($entityMetadata['fields']))) {
75
+            if (!in_array($fieldName, array_keys($entityMetadata['fields']))) {
76 76
                 continue;
77 77
             }
78 78
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         // Add eq filter for to-one associations
98 98
         foreach ($classMetadata->getAssociationNames() as $associationName) {
99 99
             // Only process fields which are in the graphql metadata
100
-            if (! in_array($associationName, array_keys($entityMetadata['fields']))) {
100
+            if (!in_array($associationName, array_keys($entityMetadata['fields']))) {
101 101
                 continue;
102 102
             }
103 103
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         $inputObject = new InputObjectType([
122 122
             'name' => $typeName,
123
-            'fields' => static function () use ($fields) {
123
+            'fields' => static function() use ($fields) {
124 124
                 return $fields;
125 125
             },
126 126
         ]);
Please login to merge, or discard this patch.