Skip to content

Commit 10d2ce4

Browse files
authored
Merge pull request #1122 from sparklink-pro/master
Update webonyx / Cleanup / Fix tests
2 parents f35dda7 + b207dd4 commit 10d2ce4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+462
-102
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ jobs:
1818
php-version:
1919
- '8.0'
2020
- '8.1'
21+
- '8.2'
2122
symfony-version:
2223
- '5.4.*'
2324
- '6.0.*'
25+
- '6.2.*'
2426
dependencies:
2527
- 'lowest'
2628
- 'highest'
2729
remove-dependencies: [ '' ]
2830
coverage: [ 'none' ]
31+
exclude:
32+
- php-version: '8.0'
33+
symfony-version: '6.2.*'
2934
include:
3035
- php-version: '8.0'
3136
symfony-version: '5.4.*'

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"symfony/http-kernel": "^5.4 || ^6.0",
4545
"symfony/options-resolver": "^5.4 || ^6.0",
4646
"symfony/property-access": "^5.4 || ^6.0",
47-
"webonyx/graphql-php": "^15.0"
47+
"webonyx/graphql-php": "^15.4"
4848
},
4949
"suggest": {
5050
"nelmio/cors-bundle": "For more flexibility when using CORS prefight",
@@ -91,7 +91,7 @@
9191
"static-analysis": [
9292
"phpstan analyse --ansi --memory-limit=1G"
9393
],
94-
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.11.0/php-cs-fixer.phar -O php-cs-fixer.phar",
94+
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.17.0/php-cs-fixer.phar -O php-cs-fixer.phar",
9595
"fix-cs": [
9696
"@install-cs",
9797
"@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi"

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ parameters:
387387

388388
-
389389
message: "#^Call to method disableOriginalConstructor\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockBuilder\\.$#"
390-
count: 1
390+
count: 2
391391
path: tests/ExpressionLanguage/TestCase.php
392392

393393
-

src/Command/GraphQLDumpSchemaCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GraphQL\Utils\SchemaPrinter;
99
use InvalidArgumentException;
1010
use Overblog\GraphQLBundle\Request\Executor as RequestExecutor;
11+
use Overblog\GraphQLBundle\Resolver\TypeResolver;
1112
use Symfony\Component\Console\Command\Command;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Input\InputOption;
@@ -27,11 +28,14 @@ final class GraphQLDumpSchemaCommand extends Command
2728
private RequestExecutor $requestExecutor;
2829
private string $baseExportPath;
2930

30-
public function __construct(string $baseExportPath, RequestExecutor $requestExecutor)
31+
public function __construct(string $baseExportPath, RequestExecutor $requestExecutor, TypeResolver $typeResolver)
3132
{
3233
parent::__construct();
3334
$this->baseExportPath = $baseExportPath;
3435
$this->requestExecutor = $requestExecutor;
36+
37+
// Disable exception when an unresolvable types is encoutered. Schema dump will try to access the Query, Mutation and Subscription types and will fail if they are not defined.
38+
$typeResolver->setIgnoreUnresolvableException(true);
3539
}
3640

3741
public function getRequestExecutor(): RequestExecutor

src/Definition/Builder/SchemaBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(TypeResolver $typeResolver, bool $enableValidation =
2323
$this->enableValidation = $enableValidation;
2424
}
2525

26-
public function getBuilder(string $name, ?string $queryAlias, ?string $mutationAlias = null, ?string $subscriptionAlias = null, array $types = []): Closure
26+
public function getBuilder(string $name, ?string $queryAlias, string $mutationAlias = null, string $subscriptionAlias = null, array $types = []): Closure
2727
{
2828
return function () use ($name, $queryAlias, $mutationAlias, $subscriptionAlias, $types): ExtensibleSchema {
2929
static $schema = null;
@@ -38,7 +38,7 @@ public function getBuilder(string $name, ?string $queryAlias, ?string $mutationA
3838
/**
3939
* @param string[] $types
4040
*/
41-
public function create(string $name, ?string $queryAlias, ?string $mutationAlias = null, ?string $subscriptionAlias = null, array $types = []): ExtensibleSchema
41+
public function create(string $name, ?string $queryAlias, string $mutationAlias = null, string $subscriptionAlias = null, array $types = []): ExtensibleSchema
4242
{
4343
$this->typeResolver->setCurrentSchemaName($name);
4444
$query = $this->typeResolver->resolve($queryAlias);

src/Definition/Type/PhpEnumType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function parseValue($value): mixed
9393
return parent::parseValue($value);
9494
}
9595

96-
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
96+
public function parseLiteral(Node $valueNode, array $variables = null): mixed
9797
{
9898
if ($this->enumClass) {
9999
if (!$valueNode instanceof EnumValueNode) {

src/Executor/Executor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function execute(
2828
$contextValue = null,
2929
$variableValues = null,
3030
$operationName = null,
31-
?callable $fieldResolver = null,
32-
?array $validationRules = null
31+
callable $fieldResolver = null,
32+
array $validationRules = null
3333
): ExecutionResult {
3434
if (!method_exists($promiseAdapter, 'wait')) {
3535
throw new RuntimeException(

src/Executor/ExecutorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function execute(
2525
$contextValue = null,
2626
$variableValues = null,
2727
$operationName = null,
28-
?callable $fieldResolver = null,
29-
?array $validationRules = null
28+
callable $fieldResolver = null,
29+
array $validationRules = null
3030
): ExecutionResult;
3131
}

src/ExpressionLanguage/ExpressionFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ExpressionFunction extends BaseExpressionFunction
1212
{
1313
protected string $gqlServices = '$'.TypeGenerator::GRAPHQL_SERVICES;
1414

15-
public function __construct(string $name, callable $compiler, ?callable $evaluator = null)
15+
public function __construct(string $name, callable $compiler, callable $evaluator = null)
1616
{
1717
if (null === $evaluator) {
1818
$evaluator = new EvaluatorIsNotAllowedException($name);

src/Generator/TypeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ private function buildScalarCallback($callback, string $fieldName)
449449
*
450450
* @throws GeneratorException
451451
*/
452-
private function buildResolve($resolve, ?array $groups = null): GeneratorInterface
452+
private function buildResolve($resolve, array $groups = null): GeneratorInterface
453453
{
454454
if (is_callable($resolve) && is_array($resolve)) {
455455
return Collection::numeric($resolve);

0 commit comments

Comments
 (0)