From 52a82dac1082dc00d871fd694082a7120d7c4064 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 17 May 2023 09:33:43 +0200 Subject: [PATCH 1/3] Use ClientInterface in MockFactory HttpClient is deprecated in favor of ClientInterface. By accepting ClientInterface in the MockFactory, developers can transition to the ClientInterface. --- src/ClientFactory/MockFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ClientFactory/MockFactory.php b/src/ClientFactory/MockFactory.php index fa743109..3c598c35 100644 --- a/src/ClientFactory/MockFactory.php +++ b/src/ClientFactory/MockFactory.php @@ -4,8 +4,8 @@ namespace Http\HttplugBundle\ClientFactory; -use Http\Client\HttpClient; use Http\Mock\Client; +use Psr\Http\Client\ClientInterface; /** * @author Gary PEGEOT @@ -13,7 +13,7 @@ final class MockFactory implements ClientFactory { /** - * @var HttpClient + * @var ClientInterface */ private $client; @@ -22,7 +22,7 @@ final class MockFactory implements ClientFactory * * Note that this can be any client, not only a mock client. */ - public function setClient(HttpClient $client) + public function setClient(ClientInterface $client) { $this->client = $client; } From 1c2252648d842915c80cf340f735a6a77bb8594d Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 17 May 2023 10:21:56 +0200 Subject: [PATCH 2/3] Require HTTPlug 2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 93313009..fbfa2b4e 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "php-http/client-common": "^1.9 || ^2.0", "php-http/client-implementation": "^1.0", "php-http/discovery": "^1.14", - "php-http/httplug": "^1.0 || ^2.0", + "php-http/httplug": "^2.0", "php-http/logger-plugin": "^1.1", "php-http/message": "^1.4", "php-http/message-factory": "^1.0.2", From f1dd9d54c7768c29af7c3348050086cac78b6b2e Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 17 May 2023 10:23:38 +0200 Subject: [PATCH 3/3] Stop testing buzz-adapter It's not compatible with HTTPlug 2.0 --- .github/workflows/continuous-integration.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index afea25eb..6b6a2647 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -44,10 +44,6 @@ jobs: php-version: "8.2" symfony-deprecations-helper: "weak" - # Test with httplug 1.x clients - - dependencies: "php-http/buzz-adapter:^1.0 php-http/guzzle6-adapter:^1.1.1 php-http/react-adapter:^0.2.1" - php-version: "7.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" php-version: "7.3"