Drop Guzzle adapters to support both Guzzle 6 and 7

This commit is contained in:
Kevin Kaniaburka 2023-04-27 12:53:42 +02:00
parent 77652769e3
commit cad50787e2
No known key found for this signature in database
GPG key ID: 8DB4C54474F3FD72
10 changed files with 21 additions and 25 deletions

View file

@ -67,8 +67,17 @@
To add more data per variant create a service implementing the `Sylius\Component\Core\Provider\ProductVariantMap\ProductVariantMapProviderInterface` and tag it with `sylius.product_variant_data_map_provider`.
1. Using Guzzle 6 has been deprecated in favor of Symfony HTTP Client.
Therefore, the constructor of `Sylius\Bundle\AdminBundle\Controller\NotificationController` has been changed:
1. Using Guzzle 6 has been deprecated in favor of Symfony HTTP Client. If you want to still use Guzzle 6 or Guzzle 7,
you need to install `composer require php-http/guzzle6-adapter` or `composer require php-http/guzzle7-adapter`
depending on your Guzzle version.
Subsequently, you need to register the adapter as a `Psr\Http\Client\ClientInterface` service as the following:
```yaml
services:
Psr\Http\Client\ClientInterface:
class: Http\Adapter\Guzzle7\Client # for Guzzle 6 use Http\Adapter\Guzzle6\Client instead
```
1. The constructor of `Sylius\Bundle\AdminBundle\Controller\NotificationController` has been changed:
```diff
public function __construct(

View file

@ -48,7 +48,7 @@
"friendsofphp/proxy-manager-lts": "^1.0.7",
"friendsofsymfony/rest-bundle": "^3.0",
"gedmo/doctrine-extensions": "^3.2",
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/guzzle": "^6.5 || ^7.0",
"guzzlehttp/psr7": "^1.8",
"jms/serializer-bundle": "^4.2",
"knplabs/gaufrette": "^0.10 || ^0.11",
@ -63,7 +63,7 @@
"pagerfanta/pagerfanta": "^3.0",
"payum/payum": "^1.7.2",
"payum/payum-bundle": "^2.5",
"php-http/guzzle6-adapter": "^2.0",
"php-http/httplug": "^2.4",
"php-http/message-factory": "^1.0",
"psr/cache": "^2.0",
"psr/http-client": "^1.0",

View file

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Sylius\Bundle\AdminBundle\Tests\Controller;
use GuzzleHttp\Exception\ConnectException;
use Http\Client\Exception\NetworkException;
use Http\Message\MessageFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
@ -62,7 +61,7 @@ final class NotificationControllerTest extends TestCase
$requestInterface->withHeader('Content-Type', 'application/json')->willReturn($requestInterface);
$requestInterface->withBody($streamInterface)->willReturn($requestInterface);
$this->client->sendRequest(Argument::cetera())->willThrow(NetworkException::class);
$this->client->sendRequest(Argument::cetera())->willThrow(ConnectException::class);
$emptyResponse = $this->controller->getVersionAction(new Request());

View file

@ -36,7 +36,6 @@
"sylius/core-bundle": "^1.12",
"sylius/ui-bundle": "^1.12",
"symfony/framework-bundle": "^5.4.21 || ^6.0",
"symfony/http-client": "^5.4.21 || ^6.0",
"symfony/webpack-encore-bundle": "^1.15",
"twig/intl-extra": "^2.12 || ^3.4",
"twig/twig": "^2.12 || ^3.3"

View file

@ -29,8 +29,7 @@
"enshrined/svg-sanitize": "^0.16",
"lexik/jwt-authentication-bundle": "^2.11",
"sylius/core-bundle": "^1.12",
"symfony/messenger": "^5.4.21 || ^6.0",
"symfony/http-client": "^5.4.21 || ^6.0"
"symfony/messenger": "^5.4.21 || ^6.0"
},
"require-dev": {
"ext-sqlite3": "*",

View file

@ -36,8 +36,6 @@
"league/flysystem-bundle": "^2.4",
"liip/imagine-bundle": "^2.10",
"nyholm/psr7": "^1.6",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0",
"sonata-project/block-bundle": "^4.2",
"sylius-labs/association-hydrator": "^1.1 || ^1.2",
"sylius-labs/doctrine-migrations-extra-bundle": "^0.1.4 || ^0.2",
@ -68,7 +66,6 @@
"sylius/ui-bundle": "^1.12",
"sylius/user-bundle": "^1.12",
"symfony/framework-bundle": "^5.4.21 || ^6.0",
"symfony/http-client": "^5.4.21 || ^6.0",
"symfony/intl": "^5.4.21 || ^6.0",
"symfony/mailer": "^5.4.21 || ^6.0",
"symfony/messenger": "^5.4.21 || ^6.0",

View file

@ -31,12 +31,12 @@
"php": "^8.0",
"payum/payum": "^1.7.2",
"payum/payum-bundle": "^2.5",
"php-http/guzzle6-adapter": "^2.0",
"sylius/core": "^1.12",
"sylius/currency": "^1.12",
"sylius/order-bundle": "^1.12",
"sylius/payment-bundle": "^1.12",
"sylius/resource-bundle": "^1.9"
"sylius/resource-bundle": "^1.9",
"php-http/httplug": "^2.4"
},
"require-dev": {
"phpspec/phpspec": "^7.2",

View file

@ -55,7 +55,6 @@
"require-dev": {
"hwi/oauth-bundle": "^1.1 || ^2.0@beta",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"php-http/guzzle6-adapter": "^2.0",
"phpspec/phpspec": "^7.2",
"phpunit/phpunit": "^9.5",
"symfony/dependency-injection": "^5.4.21 || ^6.0",

View file

@ -28,10 +28,12 @@
"require": {
"php": "^8.0",
"enshrined/svg-sanitize": "^0.16",
"guzzlehttp/guzzle": "^6.5 || ^7.0",
"knplabs/gaufrette": "^0.10 || ^0.11",
"league/flysystem": "^2.4",
"payum/payum": "^1.7.2",
"php-http/guzzle6-adapter": "^2.0",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0",
"sylius/addressing": "^1.12",
"sylius/attribute": "^1.12",
"sylius/channel": "^1.12",
@ -50,6 +52,7 @@
"sylius/taxation": "^1.12",
"sylius/taxonomy": "^1.12",
"sylius/user": "^1.12",
"symfony/http-client": "^5.4.21 || ^6.0",
"symfony/http-foundation": "^5.4.21 || ^6.0",
"symfony/mime": "^5.4.21 || ^6.0",
"symfony/string": "^5.4.21 || ^6.0",

View file

@ -406,21 +406,12 @@
"phar-io/version": {
"version": "2.0.1"
},
"php-http/guzzle6-adapter": {
"version": "v1.1.1"
},
"php-http/httplug": {
"version": "v1.1.0"
},
"php-http/message": {
"version": "1.7.0"
},
"php-http/message-factory": {
"version": "v1.0.2"
},
"php-http/promise": {
"version": "v1.0.0"
},
"phparkitect/phparkitect": {
"version": "0.2.9"
},