diff --git a/src/Executor/Promise/Promise.php b/src/Executor/Promise/Promise.php index 42c307b28..b2bf84c30 100644 --- a/src/Executor/Promise/Promise.php +++ b/src/Executor/Promise/Promise.php @@ -2,8 +2,6 @@ namespace GraphQL\Executor\Promise; -use Amp\Future as AmpFuture; -use Amp\Promise as AmpPromise; use GraphQL\Error\InvariantViolation; use GraphQL\Executor\Promise\Adapter\SyncPromise; use React\Promise\PromiseInterface as ReactPromise; @@ -13,7 +11,7 @@ */ class Promise { - /** @var SyncPromise|ReactPromise|AmpFuture|AmpPromise */ + /** @var SyncPromise|ReactPromise|\Amp\Future|\Amp\Promise */ public $adoptedPromise; private PromiseAdapter $adapter; diff --git a/tests/Executor/AbstractTest.php b/tests/Executor/AbstractTest.php index 097074e42..6c342284f 100644 --- a/tests/Executor/AbstractTest.php +++ b/tests/Executor/AbstractTest.php @@ -460,14 +460,14 @@ public static function dogCatRootValues(): iterable ], ]; yield [ - new class() { + new class { public string $__typename = 'Dog'; public string $name = 'Odie'; public bool $woofs = true; }, - new class() { + new class { public string $__typename = 'Cat'; public string $name = 'Garfield'; diff --git a/tests/Executor/ExecutorTest.php b/tests/Executor/ExecutorTest.php index 812c33d4a..ffee65d0b 100644 --- a/tests/Executor/ExecutorTest.php +++ b/tests/Executor/ExecutorTest.php @@ -1223,7 +1223,7 @@ public function testDefaultResolverGrabsValuesOffOfCommonPhpDataStructures(): vo ], 'arrayAccess' => [ 'type' => $ArrayAccess, - 'resolve' => static fn (): \ArrayAccess => new class() implements \ArrayAccess { + 'resolve' => static fn (): \ArrayAccess => new class implements \ArrayAccess { /** @param mixed $offset */ #[\ReturnTypeWillChange] public function offsetExists($offset): bool @@ -1271,7 +1271,7 @@ public function offsetUnset($offset): void {} ], 'objectField' => [ 'type' => $ObjectField, - 'resolve' => static fn (): \stdClass => new class() extends \stdClass { + 'resolve' => static fn (): \stdClass => new class extends \stdClass { public ?int $set = 1; public ?int $unset; @@ -1279,7 +1279,7 @@ public function offsetUnset($offset): void {} ], 'objectVirtual' => [ 'type' => $ObjectVirtual, - 'resolve' => static fn (): object => new class() { + 'resolve' => static fn (): object => new class { public function __isset(string $name): bool { switch ($name) { diff --git a/tests/Type/LazyDefinitionTest.php b/tests/Type/LazyDefinitionTest.php index 228276295..d7a466efc 100644 --- a/tests/Type/LazyDefinitionTest.php +++ b/tests/Type/LazyDefinitionTest.php @@ -53,7 +53,7 @@ public function testAllowsTypeWhichDefinesItFieldsAsInvokableClassReturningField $objType = new ObjectType([ 'name' => 'SomeObject', 'fields' => [ - 'f' => new class() { + 'f' => new class { /** * @throws InvariantViolation * diff --git a/tests/Type/ScalarSerializationTest.php b/tests/Type/ScalarSerializationTest.php index 8221c9a45..ca5842ed4 100644 --- a/tests/Type/ScalarSerializationTest.php +++ b/tests/Type/ScalarSerializationTest.php @@ -111,7 +111,7 @@ public function testSerializesOutputAsString(): void self::assertSame('1', $stringType->serialize(true)); self::assertSame('', $stringType->serialize(false)); self::assertSame('', $stringType->serialize(null)); - self::assertSame('foo', $stringType->serialize(new class() implements \Stringable { + self::assertSame('foo', $stringType->serialize(new class implements \Stringable { public function __toString(): string { return 'foo'; diff --git a/tests/Validator/CustomRuleTest.php b/tests/Validator/CustomRuleTest.php index e40dc1fe6..098b68f15 100644 --- a/tests/Validator/CustomRuleTest.php +++ b/tests/Validator/CustomRuleTest.php @@ -16,7 +16,7 @@ final class CustomRuleTest extends ValidatorTestCase public function testAddRuleCanReplaceDefaultRules(): void { - DocumentValidator::addRule(new class() extends ExecutableDefinitions { + DocumentValidator::addRule(new class extends ExecutableDefinitions { public function getName(): string { return ExecutableDefinitions::class;