Skip to content

Commit

Permalink
Merge pull request #1144 from sparklink-pro/master
Browse files Browse the repository at this point in the history
Symfony 7 / PHP 8.3 compatibility
  • Loading branch information
Vincz authored Dec 11, 2023
2 parents 6f87cf0 + 4413d43 commit a223567
Show file tree
Hide file tree
Showing 16 changed files with 249 additions and 230 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
symfony-version:
- '5.4.*'
- '6.0.*'
- '6.2.*'
- '6.4.*'
- '7.0.*'
dependencies:
- 'lowest'
- 'highest'
Expand All @@ -31,6 +34,12 @@ jobs:
exclude:
- php-version: '8.0'
symfony-version: '6.2.*'
- php-version: '8.0'
symfony-version: '6.4.*'
- php-version: '8.0'
symfony-version: '7.0.*'
- php-version: '8.1'
symfony-version: '7.0.*'
include:
- php-version: '8.0'
symfony-version: '5.4.*'
Expand Down
44 changes: 22 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"phpdocumentor/reflection-docblock": "^5.2",
"phpdocumentor/type-resolver": "^1.6.1",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/event-dispatcher": "^5.4 || ^6.0",
"symfony/expression-language": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/http-foundation": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/options-resolver": "^5.4 || ^6.0",
"symfony/property-access": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
"symfony/expression-language": "^5.4 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
"symfony/property-access": "^5.4 || ^6.0 || ^7.0",
"webonyx/graphql-php": "^15.4"
},
"suggest": {
Expand All @@ -55,27 +55,27 @@
"require-dev": {
"doctrine/annotations": "^1.13",
"doctrine/orm": "^2.5",
"monolog/monolog": "^2.8.0",
"monolog/monolog": "^2.8.0 || ^3.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "1.8.4",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5.10",
"react/promise": "^2.5",
"symfony/asset": "^5.4 || ^6.0",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/css-selector": "^5.4 || ^6.0",
"symfony/console": "^5.4 || ^6.0",
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/finder": "^5.4 || ^6.0",
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0",
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
"symfony/monolog-bundle": "^3.7",
"symfony/phpunit-bridge": "^6.0",
"symfony/process": "^5.4 || ^6.0",
"symfony/routing": "^5.4 || ^6.0",
"symfony/security-bundle": "^5.4 || ^6.0",
"symfony/validator": "^5.4 || ^6.0",
"symfony/var-dumper": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0",
"symfony/process": "^5.4 || ^6.0 || ^7.0",
"symfony/routing": "^5.4 || ^6.0 || ^7.0",
"symfony/security-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
"twig/twig": "^2.10|^3.0"
},
"conflict": {
Expand Down
10 changes: 5 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -441,24 +441,24 @@ parameters:
path: tests/Functional/Controller/GraphControllerTest.php

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

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

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

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

-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
Expand Down
4 changes: 1 addition & 3 deletions src/CacheWarmer/CompileCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public function isOptional(): bool
}

/**
* @param string $cacheDir
*
* @return string[]
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir, string $buildDir = null): array
{
if ($this->compiled) {
// use warm up cache dir if type generator cache dir not already explicitly declared
Expand Down
2 changes: 2 additions & 0 deletions tests/ExpressionLanguage/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ protected function getSecurityIsGrantedWithExpectation($with, $expects = null, $
$returnValue = $this->returnValue($return);
}

// @phpstan-ignore-next-line
$methodExpectation = $security
->expects($expects)
->method('isGranted');
Expand All @@ -96,6 +97,7 @@ protected function getSecurityIsGrantedWithExpectation($with, $expects = null, $
// @phpstan-ignore-next-line
$methodExpectation->will($returnValue);

// @phpstan-ignore-next-line
return new Security($security);
}

Expand Down
6 changes: 1 addition & 5 deletions tests/Functional/App/Resolver/NodeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
namespace Overblog\GraphQLBundle\Tests\Functional\App\Resolver;

use GraphQL\Type\Definition\ResolveInfo;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

final class NodeResolver implements ContainerAwareInterface
final class NodeResolver
{
use ContainerAwareTrait;

private array $userData = [
'1' => [
'id' => 1,
Expand Down
10 changes: 10 additions & 0 deletions tests/Functional/App/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
$loader->load(__DIR__.'/config/config.yml');
}

// @phpstan-ignore-next-line
if (Kernel::VERSION_ID < 60200) {
$loader->load(__DIR__.'/config/config_pre_62.yml');
}

// @phpstan-ignore-next-line
if (Kernel::VERSION_ID >= 70000) {
$loader->load(__DIR__.'/config/config_post_70.yml');
}

$loader->load(function (ContainerBuilder $container): void {
$container->addCompilerPass($this);
});
Expand Down
1 change: 0 additions & 1 deletion tests/Functional/App/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ framework:
http_method_override: false

security:
enable_authenticator_manager: true
providers:
in_memory:
memory:
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/App/config/config_post_70.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
framework:
handle_all_throwables: false
2 changes: 2 additions & 0 deletions tests/Functional/App/config/config_pre_62.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security:
enable_authenticator_manager: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ imports:
- { resource: ../config.yml }

framework:
annotations: true
validation:
enabled: true
enable_annotations: true

overblog_graphql:
definitions:
Expand Down
7 changes: 2 additions & 5 deletions tests/Functional/App/config/typeShorthand/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
imports:
- { resource: ../config.yml }
framework:
annotations: true
validation:
enabled: true
enable_annotations: true

overblog_graphql:
errors_handler:
Expand All @@ -15,6 +13,5 @@ overblog_graphql:
query: RootQuery
mappings:
types:
-
type: yaml
dir: "%kernel.project_dir%/config/typeShorthand/mapping"
- type: yaml
dir: "%kernel.project_dir%/config/typeShorthand/mapping"
3 changes: 0 additions & 3 deletions tests/Functional/App/config/validator/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ imports:
- { resource: ../config.yml }

framework:
annotations: true
validation:
enabled: true
enable_annotations: true

overblog_graphql:
definitions:
Expand Down Expand Up @@ -38,4 +36,3 @@ services:
- { name: "overblog_graphql.mutation", alias: "mutation_mock", method: "mutationMock" }
- { name: "overblog_graphql.mutation", alias: "mutation_errors", method: "mutationErrors" }
- { name: "overblog_graphql.mutation", alias: "no_validation", method: "noValidation" }

Loading

0 comments on commit a223567

Please sign in to comment.