From 91789a450c555cd17a2274a70faa4fdd741bf15c Mon Sep 17 00:00:00 2001 From: Kai Dederichs Date: Tue, 5 Dec 2023 16:22:10 +0100 Subject: [PATCH] feat: Support Symfony 7 --- .github/workflows/continuous-integration.yml | 7 +++++ CHANGELOG.md | 2 ++ composer.json | 30 +++++++++---------- tests/Functional/ServiceInstantiationTest.php | 3 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6b6a2647..aac801de 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -43,6 +43,9 @@ jobs: - dependencies: "php-http/guzzle7-adapter" php-version: "8.2" symfony-deprecations-helper: "weak" + - dependencies: "php-http/guzzle7-adapter" + php-version: "8.3" + symfony-deprecations-helper: "weak" # Test with httplug 2.x clients - dependencies: "php-http/guzzle7-adapter php-http/curl-client:^2.0.0 php-http/vcr-plugin:^1.0@dev php-http/socket-client:^2.0" @@ -68,6 +71,10 @@ jobs: symfony-require: "5.4.*" php-version: "7.3" symfony-deprecations-helper: "weak" + - dependencies: "php-http/guzzle7-adapter symfony/http-client:^6.0" + symfony-require: "6.4.*" + php-version: "8.1" + symfony-deprecations-helper: "weak" steps: - name: "Checkout" diff --git a/CHANGELOG.md b/CHANGELOG.md index 43434250..480cea37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee # Version 1 +- Added support for Symfony 7 + # 1.31.0 - 2023-11-06 - Added configuration for the `header` authentication plugin (#437). diff --git a/composer.json b/composer.json index 1f5fb212..c5680a22 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,11 @@ "php-http/message-factory": "^1.0.2", "php-http/stopwatch-plugin": "^1.2", "psr/http-message": "^1.0 || ^2.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0" + "symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0" }, "conflict": { "php-http/guzzle6-adapter": "<1.1", @@ -48,21 +48,21 @@ }, "require-dev": { "guzzlehttp/psr7": "^1.7 || ^2.0", - "matthiasnoback/symfony-dependency-injection-test": "^4.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0", "nyholm/nsa": "^1.1", "nyholm/psr7": "^1.2.1", "php-http/cache-plugin": "^1.7", "php-http/mock-client": "^1.2", "php-http/promise": "^1.0", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/cache": "^4.4 || ^5.0 || ^6.0", - "symfony/dom-crawler": "^4.4 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/http-foundation": "^4.4.19 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.3", - "symfony/stopwatch": "^4.4 || ^5.0 || ^6.0", - "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/web-profiler-bundle": "^4.4.19 || ^5.0 || ^6.0", + "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/dom-crawler": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/http-foundation": "^4.4.19 || ^5.0 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.4.1", + "symfony/stopwatch": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/web-profiler-bundle": "^4.4.19 || ^5.0 || ^6.0 || ^7.0", "twig/twig": "^1.41 || ^2.10 || ^3.0" }, "suggest": { diff --git a/tests/Functional/ServiceInstantiationTest.php b/tests/Functional/ServiceInstantiationTest.php index 35dcfffa..008b6d60 100644 --- a/tests/Functional/ServiceInstantiationTest.php +++ b/tests/Functional/ServiceInstantiationTest.php @@ -134,7 +134,8 @@ protected static function bootKernel(array $options = []): KernelInterface $dispatcher = static::$kernel->getContainer()->get('event_dispatcher'); $class = (Kernel::MAJOR_VERSION >= 5) ? RequestEvent::class : GetResponseEvent::class; - $event = new $class(static::$kernel, SymfonyRequest::create('/'), HttpKernelInterface::MASTER_REQUEST); + $requestType = (Kernel::MAJOR_VERSION >= 6) ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST; + $event = new $class(static::$kernel, SymfonyRequest::create('/'), $requestType); $dispatcher->dispatch($event, KernelEvents::REQUEST);