@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function process(mixed $field, InputObjectFieldResolverInterface $fieldResolver): Webonyx\InputObjectField |
| 34 | 34 | { |
| 35 | - if (! $field instanceof ReflectionMethod) { |
|
| 35 | + if (!$field instanceof ReflectionMethod) { |
|
| 36 | 36 | return $fieldResolver->resolve($field); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $parameter = $parameters[0]; |
| 93 | 93 | |
| 94 | - if (! $parameter->hasType()) { |
|
| 94 | + if (!$parameter->hasType()) { |
|
| 95 | 95 | throw new CantResolveGraphQLTypeException(\sprintf( |
| 96 | 96 | 'Can\'t resolve GraphQL type "%s" for field "%s". Parameter has no type.', |
| 97 | 97 | $method->getDeclaringClass()->getName(), |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function process(mixed $field, InputObjectFieldResolverInterface $fieldResolver): Webonyx\InputObjectField |
| 31 | 31 | { |
| 32 | - if (! $field instanceof ReflectionProperty) { |
|
| 32 | + if (!$field instanceof ReflectionProperty) { |
|
| 33 | 33 | return $fieldResolver->resolve($field); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | return new LazyParserType($attribute->type, $attribute->mode ?? 0, $this->typeRegistry); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (! $property->hasType()) { |
|
| 86 | + if (!$property->hasType()) { |
|
| 87 | 87 | throw new CantResolveGraphQLTypeException(\sprintf( |
| 88 | 88 | 'Can\'t resolve GraphQL type for field "%s"', |
| 89 | 89 | $property->getName() |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __invoke(mixed $value, mixed $context, Webonyx\ResolveInfo $info): ?Webonyx\ObjectType |
| 18 | 18 | { |
| 19 | - if (! \is_object($value)) { |
|
| 19 | + if (!\is_object($value)) { |
|
| 20 | 20 | return null; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function process(mixed $field, ObjectFieldResolverInterface $fieldResolver): Webonyx\FieldDefinition |
| 41 | 41 | { |
| 42 | - if (! $field instanceof ReflectionMethod) { |
|
| 42 | + if (!$field instanceof ReflectionMethod) { |
|
| 43 | 43 | return $fieldResolver->resolve($field); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return new LazyParserType($attribute->type, $attribute->mode ?? 0, $this->typeRegistry); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if (! $method->hasReturnType()) { |
|
| 97 | + if (!$method->hasReturnType()) { |
|
| 98 | 98 | throw new CantResolveGraphQLTypeException(\sprintf( |
| 99 | 99 | 'Can\'t resolve GraphQL type for field "%s"', |
| 100 | 100 | $method->getName() |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function process(mixed $field, ObjectFieldResolverInterface $fieldResolver): Webonyx\FieldDefinition |
| 31 | 31 | { |
| 32 | - if (! $field instanceof ReflectionProperty) { |
|
| 32 | + if (!$field instanceof ReflectionProperty) { |
|
| 33 | 33 | return $fieldResolver->resolve($field); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | return new LazyParserType($attribute->type, $attribute->mode ?? 0, $this->typeRegistry); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (! $property->hasType()) { |
|
| 83 | + if (!$property->hasType()) { |
|
| 84 | 84 | throw new CantResolveGraphQLTypeException(\sprintf( |
| 85 | 85 | 'Can\'t resolve GraphQL type for field "%s"', |
| 86 | 86 | $property->getName() |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | private function getFieldResolver(ReflectionProperty $property): callable |
| 98 | 98 | { |
| 99 | - return static function ($object) use ($property): mixed { |
|
| 99 | + return static function($object) use ($property): mixed { |
|
| 100 | 100 | return $property->getValue($object); |
| 101 | 101 | }; |
| 102 | 102 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function process(mixed $argument, ArgumentResolverInterface $argumentResolver): array |
| 29 | 29 | { |
| 30 | - if (! $argument instanceof ReflectionParameter) { |
|
| 30 | + if (!$argument instanceof ReflectionParameter) { |
|
| 31 | 31 | return $argumentResolver->resolve($argument); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | return new LazyParserType($attribute->type, $attribute->mode ?? 0, $this->typeRegistry); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (! $parameter->hasType()) { |
|
| 86 | + if (!$parameter->hasType()) { |
|
| 87 | 87 | throw new CantResolveGraphQLTypeException(\sprintf( |
| 88 | 88 | 'Can\'t resolve GraphQL type for argument "%s"', |
| 89 | 89 | $parameter->getName() |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function process(mixed $type, TypeResolverInterface $typeResolver): Webonyx\Type |
| 42 | 42 | { |
| 43 | - if (! \is_string($type) || ! \is_subclass_of($type, TypeInterface::class)) { |
|
| 43 | + if (!\is_string($type) || !\is_subclass_of($type, TypeInterface::class)) { |
|
| 44 | 44 | return $typeResolver->resolve($type); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | return new Webonyx\EnumType([ |
| 167 | 167 | 'name' => $type->getName(), |
| 168 | 168 | 'description' => $type->getDescription(), |
| 169 | - 'values' => static function () use ($type): iterable { |
|
| 169 | + 'values' => static function() use ($type): iterable { |
|
| 170 | 170 | foreach ($type->getValues() as $value) { |
| 171 | 171 | yield $value->getName() => [ |
| 172 | 172 | 'name' => $value->getName(), |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | ? new \ReflectionClass($type) |
| 54 | 54 | : $type; |
| 55 | 55 | |
| 56 | - if (! $class instanceof \ReflectionClass) { |
|
| 56 | + if (!$class instanceof \ReflectionClass) { |
|
| 57 | 57 | return $typeResolver->resolve($type); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return new LazyTypeResolver($this->container->get($attribute->resolveType), $this->typeRegistry); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if (! $class->isInterface() && $class->isSubclassOf(ResolveTypeAwareInterface::class)) { |
|
| 166 | + if (!$class->isInterface() && $class->isSubclassOf(ResolveTypeAwareInterface::class)) { |
|
| 167 | 167 | return new LazyTypeResolver($class->getMethod('resolveType')->getClosure(), $this->typeRegistry); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | return $this; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - private function getObjectField(int|string $name, string|array $field): AbstractObjectField |
|
| 92 | + private function getObjectField(int | string $name, string | array $field): AbstractObjectField |
|
| 93 | 93 | { |
| 94 | 94 | $fieldName = $field['name'] ?? $name; |
| 95 | 95 | |
| 96 | - if (! \is_string($fieldName)) { |
|
| 96 | + if (!\is_string($fieldName)) { |
|
| 97 | 97 | throw new CantResolveObjectFieldException( |
| 98 | 98 | 'Can\'t resolve ObjectField: wrong configuration - undefined name', |
| 99 | 99 | ); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $this->makeObjectField($fieldName, ['type' => $field]); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if (! isset($field['type']) || ! \is_string($field['type'])) { |
|
| 106 | + if (!isset($field['type']) || !\is_string($field['type'])) { |
|
| 107 | 107 | throw new CantResolveObjectFieldException( |
| 108 | 108 | 'Can\'t resolve ObjectField: wrong configuration - undefined type', |
| 109 | 109 | ); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | if (\is_array($callable)) { |
| 180 | - if (! isset($callable[0], $callable[1])) { |
|
| 180 | + if (!isset($callable[0], $callable[1])) { |
|
| 181 | 181 | throw new CantResolveObjectFieldException(\sprintf( |
| 182 | 182 | 'Can\'t resolve ObjectField: wrong configuration - %s must be callable', |
| 183 | 183 | $option |