@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function get(Entity $entity): Closure |
59 | 59 | { |
60 | - return function ($source, array $args, $context, ResolveInfo $info) { |
|
60 | + return function($source, array $args, $context, ResolveInfo $info) { |
|
61 | 61 | $fieldResolver = $this->fieldResolver; |
62 | 62 | $collection = $fieldResolver($source, $args, $context, $info); |
63 | 63 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | - if (! empty($orderBy)) { |
|
122 | + if (!empty($orderBy)) { |
|
123 | 123 | $criteria->orderBy($orderBy); |
124 | 124 | } |
125 | 125 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | 'cursor' => $cursors['last'], |
228 | 228 | ]; |
229 | 229 | |
230 | - if (! $cursors['first']) { |
|
230 | + if (!$cursors['first']) { |
|
231 | 231 | $cursors['first'] = $cursors['last']; |
232 | 232 | } |
233 | 233 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $limit = $associationLimit; |
260 | 260 | } |
261 | 261 | |
262 | - if (! $limit) { |
|
262 | + if (!$limit) { |
|
263 | 263 | $limit = $this->config->getLimit(); |
264 | 264 | } |
265 | 265 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $offset = 0; |
281 | 281 | } |
282 | 282 | |
283 | - if ($paginationFields['last'] && ! $paginationFields['before']) { |
|
283 | + if ($paginationFields['last'] && !$paginationFields['before']) { |
|
284 | 284 | $offset = $itemCount - $paginationFields['last']; |
285 | 285 | } |
286 | 286 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * For disabled hydrator cache, store only last hydrator result and reuse for consecutive calls |
45 | 45 | * then drop the cache if it doesn't hit. |
46 | 46 | */ |
47 | - if (! $this->config->getUseHydratorCache()) { |
|
47 | + if (!$this->config->getUseHydratorCache()) { |
|
48 | 48 | if (isset($this->extractValues[$splObjectHash])) { |
49 | 49 | return $this->extractValues[$splObjectHash][$info->fieldName] ?? null; |
50 | 50 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function get(Entity $entity, string $eventName): Closure |
35 | 35 | { |
36 | - return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
36 | + return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
37 | 37 | $entityClass = $entity->getEntityClass(); |
38 | 38 | |
39 | 39 | $queryBuilderFilter = (new Applicator($this->entityManager, $entityClass)) |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $itemCount = $paginator->count(); |
191 | 191 | |
192 | 192 | // Rebuild paginator if needed |
193 | - if ($paginationFields['last'] && ! $paginationFields['before']) { |
|
193 | + if ($paginationFields['last'] && !$paginationFields['before']) { |
|
194 | 194 | $offsetAndLimit['offset'] = $itemCount - $paginationFields['last']; |
195 | 195 | $queryBuilder->setFirstResult($offsetAndLimit['offset']); |
196 | 196 | $paginator = new Paginator($queryBuilder->getQuery()); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | 'cursor' => $cursors['last'], |
205 | 205 | ]; |
206 | 206 | |
207 | - if (! $cursors['first']) { |
|
207 | + if (!$cursors['first']) { |
|
208 | 208 | $cursors['first'] = $cursors['last']; |
209 | 209 | } |
210 | 210 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | $limit = $this->metadata[$entity->getEntityClass()]['limit']; |
234 | 234 | |
235 | - if (! $limit) { |
|
235 | + if (!$limit) { |
|
236 | 236 | $limit = $this->config->getLimit(); |
237 | 237 | } |
238 | 238 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $fields = []; |
42 | 42 | $targetEntity = $this->typeManager->build(Entity::class, $id); |
43 | 43 | |
44 | - if (! count($requiredFields) && ! count($optionalFields)) { |
|
44 | + if (!count($requiredFields) && !count($optionalFields)) { |
|
45 | 45 | $this->addAllFieldsAsRequired($targetEntity, $fields); |
46 | 46 | } else { |
47 | 47 | $this->addRequiredFields($targetEntity, $requiredFields, $fields); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | array &$fields, |
66 | 66 | ): void { |
67 | 67 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
68 | - if (! in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
68 | + if (!in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
69 | 69 | continue; |
70 | 70 | } |
71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | array &$fields, |
97 | 97 | ): void { |
98 | 98 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
99 | - if (! in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
99 | + if (!in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
100 | 100 | continue; |
101 | 101 | } |
102 | 102 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
23 | 23 | { |
24 | 24 | // @codeCoverageIgnoreStart |
25 | - if (! $valueNode instanceof StringValueNode) { |
|
25 | + if (!$valueNode instanceof StringValueNode) { |
|
26 | 26 | throw new Error('Query error: Uuid can only parse strings got: ' . $valueNode->kind, $valueNode); |
27 | 27 | } |
28 | 28 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | return $value; |
38 | 38 | } |
39 | 39 | |
40 | - if (! preg_match('/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/', $value)) { |
|
40 | + if (!preg_match('/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/', $value)) { |
|
41 | 41 | throw new Error('Uuid is invalid.'); |
42 | 42 | } |
43 | 43 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
23 | 23 | { |
24 | 24 | // @codeCoverageIgnoreStart |
25 | - if (! $valueNode instanceof StringValueNode) { |
|
25 | + if (!$valueNode instanceof StringValueNode) { |
|
26 | 26 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
27 | 27 | } |
28 | 28 | |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | public function parseValue(mixed $value): PHPDateTime|false |
35 | 35 | { |
36 | - if (! is_string($value)) { |
|
36 | + if (!is_string($value)) { |
|
37 | 37 | throw new Error('Time is not a string: ' . $value); |
38 | 38 | } |
39 | 39 | |
40 | - if (! preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) { |
|
40 | + if (!preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) { |
|
41 | 41 | throw new Error('Time ' . $value . ' format does not match H:i:s.u e.g. 13:34:40.867530'); |
42 | 42 | } |
43 | 43 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
23 | 23 | { |
24 | 24 | // @codeCoverageIgnoreStart |
25 | - if (! $valueNode instanceof StringValueNode) { |
|
25 | + if (!$valueNode instanceof StringValueNode) { |
|
26 | 26 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
27 | 27 | } |
28 | 28 | |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function parseValue(mixed $value): PHPDateTime |
38 | 38 | { |
39 | - if (! is_string($value)) { |
|
39 | + if (!is_string($value)) { |
|
40 | 40 | throw new Error('Time is not a string: ' . $value); |
41 | 41 | } |
42 | 42 | |
43 | - if (! preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) { |
|
43 | + if (!preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) { |
|
44 | 44 | throw new Error('Time ' . $value . ' format does not match H:i:s.u e.g. 13:34:40.867530'); |
45 | 45 | } |
46 | 46 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function parseValue(mixed $value): PHPDateTime |
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('datetime is not a string: ' . $value); |
37 | 37 | } |
38 | 38 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | public function parseValue(mixed $value): DateTimeImmutable |
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Date is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | - if (! preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $value)) { |
|
39 | + if (!preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $value)) { |
|
40 | 40 | throw new Error('Date format does not match Y-m-d e.g. 2004-02-12.'); |
41 | 41 | } |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | throw new Error('Expected DateTimeImmutable object. Got string.'); |
52 | 52 | } |
53 | 53 | |
54 | - if (! $value instanceof DateTimeImmutable) { |
|
54 | + if (!$value instanceof DateTimeImmutable) { |
|
55 | 55 | throw new Error('Expected DateTimeImmutable object. Got ' . $value::class); |
56 | 56 | } |
57 | 57 |