Skip to content

Commit 6e9f381

Browse files
authored
Merge branch 'master' into patch-1
2 parents 47f8d38 + 9516e5b commit 6e9f381

File tree

21 files changed

+285
-230
lines changed

21 files changed

+285
-230
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ jobs:
1919
- '8.0'
2020
- '8.1'
2121
- '8.2'
22+
- '8.3'
2223
symfony-version:
2324
- '5.4.*'
2425
- '6.0.*'
2526
- '6.2.*'
27+
- '6.4.*'
28+
- '7.0.*'
2629
dependencies:
2730
- 'lowest'
2831
- 'highest'
@@ -31,6 +34,12 @@ jobs:
3134
exclude:
3235
- php-version: '8.0'
3336
symfony-version: '6.2.*'
37+
- php-version: '8.0'
38+
symfony-version: '6.4.*'
39+
- php-version: '8.0'
40+
symfony-version: '7.0.*'
41+
- php-version: '8.1'
42+
symfony-version: '7.0.*'
3443
include:
3544
- php-version: '8.0'
3645
symfony-version: '5.4.*'

composer.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"phpdocumentor/reflection-docblock": "^5.2",
3636
"phpdocumentor/type-resolver": "^1.6.1",
3737
"psr/log": "^1.0 || ^2.0 || ^3.0",
38-
"symfony/config": "^5.4 || ^6.0",
39-
"symfony/dependency-injection": "^5.4 || ^6.0",
40-
"symfony/event-dispatcher": "^5.4 || ^6.0",
41-
"symfony/expression-language": "^5.4 || ^6.0",
42-
"symfony/framework-bundle": "^5.4 || ^6.0",
43-
"symfony/http-foundation": "^5.4 || ^6.0",
44-
"symfony/http-kernel": "^5.4 || ^6.0",
45-
"symfony/options-resolver": "^5.4 || ^6.0",
46-
"symfony/property-access": "^5.4 || ^6.0",
38+
"symfony/config": "^5.4 || ^6.0 || ^7.0",
39+
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
40+
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
41+
"symfony/expression-language": "^5.4 || ^6.0 || ^7.0",
42+
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
43+
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
44+
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
45+
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
46+
"symfony/property-access": "^5.4 || ^6.0 || ^7.0",
4747
"webonyx/graphql-php": "^15.4"
4848
},
4949
"suggest": {
@@ -55,27 +55,27 @@
5555
"require-dev": {
5656
"doctrine/annotations": "^1.13",
5757
"doctrine/orm": "^2.5",
58-
"monolog/monolog": "^2.8.0",
58+
"monolog/monolog": "^2.8.0 || ^3.0",
5959
"phpstan/extension-installer": "^1.0",
6060
"phpstan/phpstan": "1.8.4",
6161
"phpstan/phpstan-phpunit": "^1.0",
6262
"phpstan/phpstan-symfony": "^1.0",
6363
"phpunit/phpunit": "^9.5.10",
6464
"react/promise": "^2.5",
65-
"symfony/asset": "^5.4 || ^6.0",
66-
"symfony/browser-kit": "^5.4 || ^6.0",
67-
"symfony/css-selector": "^5.4 || ^6.0",
68-
"symfony/console": "^5.4 || ^6.0",
69-
"symfony/dom-crawler": "^5.4 || ^6.0",
70-
"symfony/finder": "^5.4 || ^6.0",
65+
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
66+
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
67+
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
68+
"symfony/console": "^5.4 || ^6.0 || ^7.0",
69+
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0",
70+
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
7171
"symfony/monolog-bundle": "^3.7",
7272
"symfony/phpunit-bridge": "^6.0",
73-
"symfony/process": "^5.4 || ^6.0",
74-
"symfony/routing": "^5.4 || ^6.0",
75-
"symfony/security-bundle": "^5.4 || ^6.0",
76-
"symfony/validator": "^5.4 || ^6.0",
77-
"symfony/var-dumper": "^5.4 || ^6.0",
78-
"symfony/yaml": "^5.4 || ^6.0",
73+
"symfony/process": "^5.4 || ^6.0 || ^7.0",
74+
"symfony/routing": "^5.4 || ^6.0 || ^7.0",
75+
"symfony/security-bundle": "^5.4 || ^6.0 || ^7.0",
76+
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
77+
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
78+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
7979
"twig/twig": "^2.10|^3.0"
8080
},
8181
"conflict": {

phpstan-baseline.neon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,24 +441,24 @@ parameters:
441441
path: tests/Functional/Controller/GraphControllerTest.php
442442

443443
-
444-
message: "#^Method Overblog\\\\GraphQLBundle\\\\Tests\\\\Functional\\\\TestCase\\:\\:createKernel\\(\\) should return Symfony\\\\Component\\\\HttpKernel\\\\KernelInterface but returns object\\.$#"
444+
message: "#^Method Overblog\\\\GraphQLBundle\\\\Tests\\\\Functional\\\\BaseTestCase\\:\\:createKernel\\(\\) should return Symfony\\\\Component\\\\HttpKernel\\\\KernelInterface but returns object\\.$#"
445445
count: 1
446-
path: tests/Functional/TestCase.php
446+
path: tests/Functional/BaseTestCase.php
447447

448448
-
449449
message: "#^Missing call to parent\\:\\:tearDown\\(\\) method\\.$#"
450450
count: 1
451-
path: tests/Functional/TestCase.php
451+
path: tests/Functional/BaseTestCase.php
452452

453453
-
454454
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
455455
count: 1
456-
path: tests/Functional/TestCase.php
456+
path: tests/Functional/BaseTestCase.php
457457

458458
-
459459
message: "#^Parameter \\#3 \\$message of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) expects string, string\\|false given\\.$#"
460460
count: 1
461-
path: tests/Functional/TestCase.php
461+
path: tests/Functional/BaseTestCase.php
462462

463463
-
464464
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"

src/CacheWarmer/CompileCacheWarmer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ public function isOptional(): bool
2727
}
2828

2929
/**
30-
* @param string $cacheDir
31-
*
3230
* @return string[]
3331
*/
34-
public function warmUp($cacheDir)
32+
public function warmUp(string $cacheDir, string $buildDir = null): array
3533
{
3634
if ($this->compiled) {
3735
// use warm up cache dir if type generator cache dir not already explicitly declared

src/Config/Parser/MetadataParser/MetadataParser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ private static function processFile(SplFileInfo $file, ContainerBuilder $contain
134134
}
135135

136136
return $preProcess ? self::$map->toArray() : $gqlTypes;
137+
} catch (ReflectionException $e) {
138+
return $gqlTypes;
137139
} catch (\InvalidArgumentException $e) {
138140
throw new InvalidArgumentException(sprintf('Failed to parse GraphQL metadata from file "%s".', $file), $e->getCode(), $e);
139141
}

tests/Config/Parser/MetadataParserTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,4 +615,30 @@ public function testInvalidProviderMutationOnQuery(): void
615615
$this->assertMatchesRegularExpression('/try to add a mutation on type "RootQuery2"/', $e->getPrevious()->getMessage());
616616
}
617617
}
618+
619+
public function testInvalidPhpFiles(): void
620+
{
621+
$files = [
622+
__DIR__.'/fixtures/annotations/Invalid/HasNoClass.php',
623+
__DIR__.'/fixtures/annotations/Invalid/EmptyPhpFile.php',
624+
__DIR__.'/fixtures/annotations/Invalid/NotAPhpFile',
625+
__DIR__.'/fixtures/annotations/Type/RootQuery.php',
626+
];
627+
$this->parser('reset', $this->parserConfig);
628+
629+
foreach ($files as $file) {
630+
$this->parser('preParse', new SplFileInfo($file), $this->containerBuilder, $this->parserConfig);
631+
}
632+
633+
$config = [];
634+
foreach ($files as $file) {
635+
$config += self::cleanConfig($this->parser('parse', new SplFileInfo($file), $this->containerBuilder, $this->parserConfig));
636+
}
637+
638+
$this->assertSame([
639+
'RootQuery' => [
640+
'type' => 'object',
641+
],
642+
], $config);
643+
}
618644
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
declare(strict_types=1);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
return function (): void {};

tests/Config/Parser/fixtures/annotations/Invalid/NotAPhpFile

Whitespace-only changes.

tests/ExpressionLanguage/TestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ protected function getSecurityIsGrantedWithExpectation($with, $expects = null, $
8787
$returnValue = $this->returnValue($return);
8888
}
8989

90+
// @phpstan-ignore-next-line
9091
$methodExpectation = $security
9192
->expects($expects)
9293
->method('isGranted');
@@ -96,6 +97,7 @@ protected function getSecurityIsGrantedWithExpectation($with, $expects = null, $
9697
// @phpstan-ignore-next-line
9798
$methodExpectation->will($returnValue);
9899

100+
// @phpstan-ignore-next-line
99101
return new Security($security);
100102
}
101103

0 commit comments

Comments
 (0)