From 0f5ce5f2e1f3ab8c106e648e606540501cc718e2 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Fri, 24 Mar 2023 16:22:09 +0100 Subject: [PATCH 1/5] EWPP-2993: Allow to install with Drupal 10. --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5177a46..f20d53e 100644 --- a/composer.json +++ b/composer.json @@ -15,14 +15,14 @@ "phpdocumentor/type-resolver": "^1.4", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "symfony/options-resolver": "^4.4.30 || ^5", - "symfony/property-info": "^4.4", - "symfony/serializer": "^4.4" + "symfony/options-resolver": "^4.4.30 || ^5 || ^6.2", + "symfony/property-info": "^4.4 || ^6.2", + "symfony/serializer": "^4.4 || ^6.2" }, "require-dev": { "guzzlehttp/psr7": "^1.8", "http-interop/http-factory-guzzle": "^1.0", - "openeuropa/code-review": "2.x-dev", + "openeuropa/code-review": "^2.0.0-alpha6", "php-http/guzzle7-adapter": "^1.0", "phpunit/phpunit": "^9.4" }, From b10f178df9b157b57091aa7d9c770b256a15cd00 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Fri, 24 Mar 2023 17:18:05 +0100 Subject: [PATCH 2/5] EWPP-2993: The package symfony/property-access is mandatory on 6.x. The package was already marked as mandatory for Symfony 4.x but it wasn't directly used in the portions of code that were running, so it was never caught. --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f20d53e..ed35392 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "prefer-stable": true, "require": { "php": ">=8.0", - "ext-json": "*", "ext-fileinfo": "*", + "ext-json": "*", "league/container": "^3.3", "php-http/multipart-stream-builder": "^1.1", "phpdocumentor/reflection-docblock": "^5.2", @@ -16,6 +16,7 @@ "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "symfony/options-resolver": "^4.4.30 || ^5 || ^6.2", + "symfony/property-access": "^4.4 || ^6.2", "symfony/property-info": "^4.4 || ^6.2", "symfony/serializer": "^4.4 || ^6.2" }, From b2f145f7e95b584bd5b14363066d199368e68022 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Mon, 27 Mar 2023 18:42:16 +0200 Subject: [PATCH 3/5] EWPP-2993: Explicitly require http factory and client implementations. --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index ed35392..f42109c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,9 @@ "phpdocumentor/reflection-docblock": "^5.2", "phpdocumentor/type-resolver": "^1.4", "psr/http-client": "^1.0", + "psr/http-client-implementation": "*", "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "*", "symfony/options-resolver": "^4.4.30 || ^5 || ^6.2", "symfony/property-access": "^4.4 || ^6.2", "symfony/property-info": "^4.4 || ^6.2", From 76b34e150c0c5391535e77f0a8aac3f0a5b0a170 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Mon, 27 Mar 2023 18:55:46 +0200 Subject: [PATCH 4/5] EWPP-2993: Guzzle 7.x is already PSR-18 compatible. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f42109c..1a07076 100644 --- a/composer.json +++ b/composer.json @@ -23,15 +23,15 @@ "symfony/serializer": "^4.4 || ^6.2" }, "require-dev": { + "guzzlehttp/guzzle": "^7", "guzzlehttp/psr7": "^1.8", "http-interop/http-factory-guzzle": "^1.0", "openeuropa/code-review": "^2.0.0-alpha6", - "php-http/guzzle7-adapter": "^1.0", "phpunit/phpunit": "^9.4" }, "suggest": { "http-interop/http-factory-guzzle": "PSR-17 HTTP Factories implementation for Guzzle", - "php-http/guzzle7-adapter": "PSR-18 HTTP Client implementation for Guzzle" + "guzzlehttp/guzzle": "PSR-18 HTTP Client implementation" }, "autoload": { "psr-4": { From 9dbdcade91aea1c8d9fa6882c5c4f3ac142f9c36 Mon Sep 17 00:00:00 2001 From: Francesco Sardara Date: Mon, 27 Mar 2023 19:00:31 +0200 Subject: [PATCH 5/5] EWPP-2993: Use 2.x of guzzlehttp/psr7 for HTTP factories. --- composer.json | 7 +++---- tests/src/Traits/ClientTestTrait.php | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 1a07076..22a7cee 100644 --- a/composer.json +++ b/composer.json @@ -24,14 +24,13 @@ }, "require-dev": { "guzzlehttp/guzzle": "^7", - "guzzlehttp/psr7": "^1.8", - "http-interop/http-factory-guzzle": "^1.0", + "guzzlehttp/psr7": "^2", "openeuropa/code-review": "^2.0.0-alpha6", "phpunit/phpunit": "^9.4" }, "suggest": { - "http-interop/http-factory-guzzle": "PSR-17 HTTP Factories implementation for Guzzle", - "guzzlehttp/guzzle": "PSR-18 HTTP Client implementation" + "guzzlehttp/guzzle": "PSR-18 HTTP Client implementation", + "guzzlehttp/psr7": "PSR-17 HTTP Factories implementation" }, "autoload": { "psr-4": { diff --git a/tests/src/Traits/ClientTestTrait.php b/tests/src/Traits/ClientTestTrait.php index 828d6a5..82ab3aa 100644 --- a/tests/src/Traits/ClientTestTrait.php +++ b/tests/src/Traits/ClientTestTrait.php @@ -8,9 +8,7 @@ use GuzzleHttp\HandlerStack; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Middleware; -use Http\Factory\Guzzle\RequestFactory; -use Http\Factory\Guzzle\StreamFactory; -use Http\Factory\Guzzle\UriFactory; +use GuzzleHttp\Psr7\HttpFactory; use OpenEuropa\EuropaSearchClient\Client; use OpenEuropa\EuropaSearchClient\Contract\ClientInterface; @@ -31,11 +29,12 @@ protected function getTestingClient(array $configuration = [], array $responseQu $handlerStack = HandlerStack::create(new MockHandler($responseQueue)); $handlerStack->push(Middleware::history($this->clientHistory)); + $httpFactory = new HttpFactory(); return new Client( new HttpClient(['handler' => $handlerStack]), - new RequestFactory(), - new StreamFactory(), - new UriFactory(), + $httpFactory, + $httpFactory, + $httpFactory, $configuration ); }