Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Executor/Promise/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,7 +11,7 @@
*/
class Promise
{
/** @var SyncPromise|ReactPromise<mixed>|AmpFuture<mixed>|AmpPromise<mixed> */
/** @var SyncPromise|ReactPromise<mixed>|\Amp\Future<mixed>|\Amp\Promise<mixed> */
public $adoptedPromise;

private PromiseAdapter $adapter;
Expand Down
4 changes: 2 additions & 2 deletions tests/Executor/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions tests/Executor/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1271,15 +1271,15 @@ 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;
},
],
'objectVirtual' => [
'type' => $ObjectVirtual,
'resolve' => static fn (): object => new class() {
'resolve' => static fn (): object => new class {
public function __isset(string $name): bool
{
switch ($name) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/LazyDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testAllowsTypeWhichDefinesItFieldsAsInvokableClassReturningField
$objType = new ObjectType([
'name' => 'SomeObject',
'fields' => [
'f' => new class() {
'f' => new class {
/**
* @throws InvariantViolation
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/ScalarSerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion tests/Validator/CustomRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading