diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bb91f8..84cef02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,9 @@ # Change Log -## [NOT RELEASED] - -### Added +## 0.4.0 - Add support for Symfony 7 +- Drop support for PHP 7 and PHP 8.0 ## 0.3.1 diff --git a/composer.json b/composer.json index 5ad62eb..96d247c 100644 --- a/composer.json +++ b/composer.json @@ -10,15 +10,15 @@ } ], "require": { - "php": ">=8.0.5", - "symfony/runtime": "^5.4 || ^6.0 || ^7.0" + "php": ">=8.1", + "symfony/runtime": "^5.4.26 || ^6.3.2 || ^7.0" }, "require-dev": { "illuminate/http": "^9.14", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "swoole/ide-helper": "^4.6", - "symfony/http-foundation": "^5.4 || ^6.0 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0" + "symfony/http-foundation": "^5.4.32 || ^6.3.9 || ^7.0", + "symfony/http-kernel": "^5.4.33 || ^6.3.10 || ^7.0" }, "conflict": { "ext-swoole": "<4.6.0" diff --git a/src/SymfonyHttpBridge.php b/src/SymfonyHttpBridge.php index ca26c2e..27303f6 100644 --- a/src/SymfonyHttpBridge.php +++ b/src/SymfonyHttpBridge.php @@ -38,7 +38,9 @@ public static function convertSwooleRequest(Request $request): SymfonyRequest public static function reflectSymfonyResponse(SymfonyResponse $sfResponse, Response $response): void { foreach ($sfResponse->headers->all() as $name => $values) { - $response->header((string) $name, $values); + foreach ((array) $values as $value) { + $response->header((string) $name, $value); + } } $response->status($sfResponse->getStatusCode()); diff --git a/tests/Unit/SymfonyHttpBridgeTest.php b/tests/Unit/SymfonyHttpBridgeTest.php index b2ef8da..fa3ec36 100644 --- a/tests/Unit/SymfonyHttpBridgeTest.php +++ b/tests/Unit/SymfonyHttpBridgeTest.php @@ -72,9 +72,10 @@ public function testThatSymfonyResponseIsReflected(): void $sfResponse->expects(self::once())->method('getContent')->willReturn('Test'); $response = $this->createMock(Response::class); - $response->expects(self::exactly(2))->method('header')->withConsecutive( - ['x-test', ['Swoole-Runtime']], - ['set-cookie', [$fooCookie, $barCookie]] + $response->expects(self::exactly(3))->method('header')->withConsecutive( + ['x-test', 'Swoole-Runtime'], + ['set-cookie', $fooCookie], + ['set-cookie', $barCookie] ); $response->expects(self::once())->method('status')->with(201); $response->expects(self::once())->method('end')->with('Test');