@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function parseValue(mixed $value): mixed |
| 27 | 27 | { |
| 28 | - if (! is_string($value)) { |
|
| 28 | + if (!is_string($value)) { |
|
| 29 | 29 | throw new Error('Blob field as base64 is not a string: ' . $value); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function serialize(mixed $value): mixed |
| 42 | 42 | { |
| 43 | - if (! $value) { |
|
| 43 | + if (!$value) { |
|
| 44 | 44 | return $value; |
| 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,11 +32,11 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function parseValue(mixed $value): DateTimeImmutable|false |
| 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 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | throw new Error('Expected DateTimeImmutable object. Got string.'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (! $value instanceof DateTimeImmutable) { |
|
| 52 | + if (!$value instanceof DateTimeImmutable) { |
|
| 53 | 53 | throw new Error('Expected DateTimeImmutable object. Got ' . $value::class); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -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): PHPDateTimeImmutable |
| 34 | 34 | { |
| 35 | - if (! is_string($value)) { |
|
| 35 | + if (!is_string($value)) { |
|
| 36 | 36 | throw new Error('datetime_immutable is not a string: ' . $value); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * Attribute to define an entity for GraphQL |
| 12 | 12 | */ |
| 13 | -#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] |
|
| 13 | +#[Attribute(Attribute::TARGET_CLASS|Attribute::IS_REPEATABLE)] |
|
| 14 | 14 | final class Entity |
| 15 | 15 | { |
| 16 | 16 | use ExcludeFilters; |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * Attribute to describe a field for GraphQL |
| 12 | 12 | */ |
| 13 | -#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] |
|
| 13 | +#[Attribute(Attribute::TARGET_PROPERTY|Attribute::IS_REPEATABLE)] |
|
| 14 | 14 | class Field |
| 15 | 15 | { |
| 16 | 16 | use ExcludeFilters; |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * Attribute to describe an association for GraphQL |
| 12 | 12 | */ |
| 13 | -#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] |
|
| 13 | +#[Attribute(Attribute::TARGET_PROPERTY|Attribute::IS_REPEATABLE)] |
|
| 14 | 14 | class Association |
| 15 | 15 | { |
| 16 | 16 | use ExcludeFilters; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function get(Entity $entity, string|null $eventName): Closure |
| 36 | 36 | { |
| 37 | - return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
| 37 | + return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
| 38 | 38 | $entityClass = $entity->getEntityClass(); |
| 39 | 39 | $queryBuilderFilter = new QueryBuilderFilter(); |
| 40 | 40 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $itemCount = $paginator->count(); |
| 148 | 148 | |
| 149 | 149 | // Rebuild paginator if needed |
| 150 | - if ($paginationFields['last'] && ! $paginationFields['before']) { |
|
| 150 | + if ($paginationFields['last'] && !$paginationFields['before']) { |
|
| 151 | 151 | $offsetAndLimit['offset'] = $itemCount - $paginationFields['last']; |
| 152 | 152 | $queryBuilder->setFirstResult($offsetAndLimit['offset']); |
| 153 | 153 | $paginator = new Paginator($queryBuilder->getQuery()); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | 'cursor' => $cursors['last'], |
| 162 | 162 | ]; |
| 163 | 163 | |
| 164 | - if (! $cursors['first']) { |
|
| 164 | + if (!$cursors['first']) { |
|
| 165 | 165 | $cursors['first'] = $cursors['last']; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $limit = $this->metadata[$entity->getEntityClass()]['limit']; |
| 191 | 191 | |
| 192 | - if (! $limit) { |
|
| 192 | + if (!$limit) { |
|
| 193 | 193 | $limit = $this->config->getLimit(); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | * For disabled hydrator cache, store only the last hydrator result and reuse for consecutive calls |
| 47 | 47 | * then drop the cache if it doesn't hit. |
| 48 | 48 | */ |
| 49 | - if (! $this->config->getUseHydratorCache()) { |
|
| 49 | + if (!$this->config->getUseHydratorCache()) { |
|
| 50 | 50 | if (isset($this->extractValues[$splObjectHash])) { |
| 51 | 51 | return $this->extractValues[$splObjectHash][$info->fieldName] ?? null; |
| 52 | 52 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | ); |