Skip to content

Commit a223567

Browse files
authored
Merge pull request #1144 from sparklink-pro/master
Symfony 7 / PHP 8.3 compatibility
2 parents 6f87cf0 + 4413d43 commit a223567

File tree

16 files changed

+249
-230
lines changed

16 files changed

+249
-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

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

tests/Functional/App/Resolver/NodeResolver.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
namespace Overblog\GraphQLBundle\Tests\Functional\App\Resolver;
66

77
use GraphQL\Type\Definition\ResolveInfo;
8-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
9-
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
108

11-
final class NodeResolver implements ContainerAwareInterface
9+
final class NodeResolver
1210
{
13-
use ContainerAwareTrait;
14-
1511
private array $userData = [
1612
'1' => [
1713
'id' => 1,

tests/Functional/App/TestKernel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
7373
$loader->load(__DIR__.'/config/config.yml');
7474
}
7575

76+
// @phpstan-ignore-next-line
77+
if (Kernel::VERSION_ID < 60200) {
78+
$loader->load(__DIR__.'/config/config_pre_62.yml');
79+
}
80+
81+
// @phpstan-ignore-next-line
82+
if (Kernel::VERSION_ID >= 70000) {
83+
$loader->load(__DIR__.'/config/config_post_70.yml');
84+
}
85+
7686
$loader->load(function (ContainerBuilder $container): void {
7787
$container->addCompilerPass($this);
7888
});

tests/Functional/App/config/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ framework:
99
http_method_override: false
1010

1111
security:
12-
enable_authenticator_manager: true
1312
providers:
1413
in_memory:
1514
memory:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
framework:
2+
handle_all_throwables: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
security:
2+
enable_authenticator_manager: true

0 commit comments

Comments
 (0)