Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/Utils/SchemaExtender.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
$field = $oldFieldMap[$fieldName];

$newFieldMap[$fieldName] = [
...$field->config,

Check failure on line 522 in src/Utils/SchemaExtender.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Array unpacking cannot be used on an array with string keys: array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...}

Check failure on line 522 in src/Utils/SchemaExtender.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Array unpacking cannot be used on an array with string keys: array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...}
'name' => $fieldName,
'description' => $field->description,
'deprecationReason' => $field->deprecationReason,
Expand All @@ -543,7 +544,7 @@
}
}

return $newFieldMap;

Check failure on line 547 in src/Utils/SchemaExtender.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Method GraphQL\Utils\SchemaExtender::extendFieldMap() should return array<string, array<string, mixed>> but returns array<string, (array<int|string, bool|(callable)|GraphQL\Language\AST\FieldDefinitionNode|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|iterable<array<string, mixed>|(callable)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|string|null>)>.

Check failure on line 547 in src/Utils/SchemaExtender.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Method GraphQL\Utils\SchemaExtender::extendFieldMap() should return array<string, array<string, mixed>> but returns array<string, (array<int|string, bool|(callable)|GraphQL\Language\AST\FieldDefinitionNode|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|iterable<array<string, mixed>|(callable)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|string|null>)>.
}

/** @throws InvariantViolation */
Expand Down
57 changes: 50 additions & 7 deletions tests/Utils/SchemaExtenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
use GraphQL\Language\AST\DocumentNode;
use GraphQL\Language\AST\FieldDefinitionNode;
use GraphQL\Language\AST\IntValueNode;
use GraphQL\Language\AST\Node;
use GraphQL\Language\AST\NodeList;
use GraphQL\Language\AST\ObjectTypeDefinitionNode;
use GraphQL\Language\AST\ObjectTypeExtensionNode;
use GraphQL\Language\AST\SchemaDefinitionNode;
use GraphQL\Language\Parser;
use GraphQL\Language\Printer;
Expand Down Expand Up @@ -1731,7 +1734,8 @@
$helloResolveFn = $extendedQueryType->getField('hello')->resolveFn;
self::assertIsCallable($helloResolveFn);

$query = /** @lang GraphQL */ '{ hello }';
$query /** @lang GraphQL */
= '{ hello }';
Comment on lines +1737 to +1738
$result = GraphQL::executeQuery($extendedSchema, $query);
self::assertSame(['data' => ['hello' => $value]], $result->toArray());
}
Expand Down Expand Up @@ -1767,15 +1771,17 @@
$queryResolveFieldFn = $extendedQueryType->resolveFieldFn;
self::assertIsCallable($queryResolveFieldFn);

$query = /** @lang GraphQL */ '{ hello }';
$query /** @lang GraphQL */
= '{ hello }';
Comment on lines +1774 to +1775
$result = GraphQL::executeQuery($extendedSchema, $query);
self::assertSame(['data' => ['hello' => $value]], $result->toArray());
}

/** @see https://github.com/webonyx/graphql-php/issues/180 */
public function testShouldBeAbleToIntroduceNewTypesThroughExtension(): void
{
$sdl = /** @lang GraphQL */ '
$sdl /** @lang GraphQL */
= '
Comment on lines +1783 to +1784
type Query {
defaultValue: String
}
Expand All @@ -1788,7 +1794,8 @@
$documentNode = Parser::parse($sdl);
$schema = BuildSchema::build($documentNode);

$extensionSdl = /** @lang GraphQL */ '
$extensionSdl /** @lang GraphQL */
= '
Comment on lines +1797 to +1798
type Bar {
foo: Foo
}
Expand Down Expand Up @@ -1836,6 +1843,39 @@
self::assertTrue($extendedDirective->isRepeatable);
}

public function testCustomConfigIsTransferred(): void
{
$fieldConfigDecorator = function (
array $typeConfig,
FieldDefinitionNode $fieldDefinitionNode,
Node $node
) {
if (($node instanceof ObjectTypeDefinitionNode || $node instanceof ObjectTypeExtensionNode) && $node->name->value === 'Test' && ($fieldDefinitionNode->name->value === 'field1' || $fieldDefinitionNode->name->value === 'field2')) {
$typeConfig['customAttr'] = true;
}

return $typeConfig;
};
$schema = BuildSchema::build(/** @lang GraphQL */ '
type Test {
field1: String!
}
', null, [], $fieldConfigDecorator);

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.4)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1863 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.5)

Parameter #4 $fieldConfigDecorator of static method GraphQL\Utils\BuildSchema::build() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

$type = $schema->getType('Test');
assert($type instanceof ObjectType);
$field1 = $type->getField('field1');
self::assertArrayHasKey('customAttr', $field1->config);

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1868 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.5)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

$extendedSchema = SchemaExtender::extend($schema, Parser::parse(/** @lang GraphQL */ 'extend type Test { field2: String! }'), [], null, $fieldConfigDecorator);

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.4)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.

Check failure on line 1870 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.5)

Parameter #5 $fieldConfigDecorator of static method GraphQL\Utils\SchemaExtender::extend() expects (callable(array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null}, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\InterfaceTypeDefinitionNode|GraphQL\Language\AST\InterfaceTypeExtensionNode|GraphQL\Language\AST\ObjectTypeDefinitionNode|GraphQL\Language\AST\ObjectTypeExtensionNode): array{type: callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed|null, args?: iterable<array{name?: string, type: callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed|null, description?: string|null, visible?: bool|callable(): bool, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\FieldDefinitionNode|null, complexity?: callable(int, array<string, mixed>): int|null})|null, Closure(array, GraphQL\Language\AST\FieldDefinitionNode, GraphQL\Language\AST\Node): array given.
$type = $extendedSchema->getType('Test');
assert($type instanceof ObjectType);
$field1 = $type->getField('field1');
self::assertArrayHasKey('customAttr', $field1->config);

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1874 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.5)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.
$field2 = $type->getField('field2');
self::assertArrayHasKey('customAttr', $field2->config);

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (7.4)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.1)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.

Check failure on line 1876 in tests/Utils/SchemaExtenderTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.5)

Call to static method PHPUnit\Framework\Assert::assertArrayHasKey() with 'customAttr' and array{name: string, type: (callable(): (GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\OutputType&GraphQL\Type\Definition\Type), resolve?: (callable(mixed, array<string, mixed>, mixed, GraphQL\Type\Definition\ResolveInfo): mixed)|null, args?: iterable<array{name?: string, type: (callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type), defaultValue?: mixed, description?: string|null, deprecationReason?: string|null, astNode?: GraphQL\Language\AST\InputValueDefinitionNode|null}|(callable(): (GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type))|(GraphQL\Type\Definition\InputType&GraphQL\Type\Definition\Type)>|null, argsMapper?: (callable(array<string, mixed>, GraphQL\Type\Definition\FieldDefinition, GraphQL\Language\AST\FieldNode, mixed): mixed)|null, description?: string|null, visible?: bool|(callable(): bool), deprecationReason?: string|null, ...} will always evaluate to false.
}

public function testSupportsTypeConfigDecorator(): void
{
$helloValue = 'Hello World!';
Expand Down Expand Up @@ -1886,7 +1926,8 @@

$extendedSchema = SchemaExtender::extend($schema, $documentNode, [], $typeConfigDecorator, $fieldConfigDecorator);

$query = /** @lang GraphQL */ '
$query /** @lang GraphQL */
= '
Comment on lines +1929 to +1930
{
hello
foo {
Expand Down Expand Up @@ -1994,7 +2035,8 @@
$SomeInterfaceClassType->concrete = $ExtendedFooType;
$SomeUnionClassType->concrete = $ExtendedFooType;

$query = /** @lang GraphQL */ '
$query /** @lang GraphQL */
= '
Comment on lines +2038 to +2039
{
someUnion {
__typename
Expand Down Expand Up @@ -2052,7 +2094,8 @@

$extendedSchema = SchemaExtender::extend($schema, $documentNode);

$query = /** @lang GraphQL */ '
$query /** @lang GraphQL */
= '
Comment on lines +2097 to +2098
{
someInterface {
__typename
Expand Down
Loading