From 7579b5d1f95114a7a71cfb44463e23de324e43d4 Mon Sep 17 00:00:00 2001 From: ruudk Date: Tue, 24 May 2022 14:42:32 +0000 Subject: [PATCH] Apply php-cs-fixer changes --- src/Type/Definition/TypeReference.php | 10 +++------- src/Type/Schema.php | 3 +-- tests/Type/TypeReferenceTypeLoaderTest.php | 5 ++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Type/Definition/TypeReference.php b/src/Type/Definition/TypeReference.php index 374f1120f..ceadabfa2 100644 --- a/src/Type/Definition/TypeReference.php +++ b/src/Type/Definition/TypeReference.php @@ -4,8 +4,6 @@ namespace GraphQL\Type\Definition; -use GraphQL\Error\Error; - class TypeReference extends Type implements NullableType, NamedType { public string $name; @@ -15,17 +13,15 @@ public function __construct(string $name) $this->name = $name; } - public function assertValid() : void + public function assertValid(): void { - } - public function isBuiltInType() : bool + public function isBuiltInType(): bool { - } - public function toString() : string + public function toString(): string { return $this->name; } diff --git a/src/Type/Schema.php b/src/Type/Schema.php index da99b1712..7493dc5f3 100644 --- a/src/Type/Schema.php +++ b/src/Type/Schema.php @@ -216,7 +216,7 @@ private function collectAllTypes(): array */ private function resolveTypeReference(Type $type, array &$typeMap): Type { - if (!$type instanceof TypeReference) { + if (! $type instanceof TypeReference) { return $type; } @@ -333,7 +333,6 @@ public function getType(string $name): ?Type return $this->getType($name); } - return $this->resolvedTypes[$name]; } diff --git a/tests/Type/TypeReferenceTypeLoaderTest.php b/tests/Type/TypeReferenceTypeLoaderTest.php index f7b8ab13c..3c9f36c21 100644 --- a/tests/Type/TypeReferenceTypeLoaderTest.php +++ b/tests/Type/TypeReferenceTypeLoaderTest.php @@ -2,7 +2,6 @@ namespace GraphQL\Tests\Type; -use GraphQL\Error\InvariantViolation; use GraphQL\Type\Definition\InputObjectType; use GraphQL\Type\Definition\InterfaceType; use GraphQL\Type\Definition\ObjectType; @@ -24,7 +23,7 @@ public function setUp(): void 'fields' => [ 'id' => Type::string(), ], - 'resolveType' => static fn() : ?ObjectType => null, + 'resolveType' => static fn (): ?ObjectType => null, ]), 'Content' => new InterfaceType([ 'name' => 'Content', @@ -32,7 +31,7 @@ public function setUp(): void 'title' => Type::string(), 'body' => Type::string(), ], - 'resolveType' => static fn() : ?ObjectType => null, + 'resolveType' => static fn (): ?ObjectType => null, ]), 'BlogStory' => new ObjectType([ 'name' => 'BlogStory',