@@ -52,7 +52,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
211 | 211 | ]; |
212 | 212 | |
213 | 213 | $lastCursor = $cursor; |
214 | - if (! $firstCursor) { |
|
214 | + if (!$firstCursor) { |
|
215 | 215 | $firstCursor = $cursor; |
216 | 216 | } |
217 | 217 |
@@ -22,12 +22,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) { |
@@ -32,9 +32,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ]); |
@@ -32,7 +32,7 @@ discard block |
||
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)) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | foreach ($filterTypes as $field => $filters) { |
65 | 65 | // Allow for custom filters |
66 | - if (! is_array($filters)) { |
|
66 | + if (!is_array($filters)) { |
|
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $paginator = new Paginator($queryBuilder->getQuery()); |
187 | 187 | $itemCount = $paginator->count(); |
188 | 188 | |
189 | - if ($last && ! $before) { |
|
189 | + if ($last && !$before) { |
|
190 | 190 | $offset = $itemCount - $last; |
191 | 191 | $queryBuilder->setFirstResult($offset); |
192 | 192 | $paginator = new Paginator($queryBuilder->getQuery()); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | ]; |
206 | 206 | |
207 | 207 | $lastCursor = $cursor; |
208 | - if (! $firstCursor) { |
|
208 | + if (!$firstCursor) { |
|
209 | 209 | $firstCursor = $cursor; |
210 | 210 | } |
211 | 211 |