From 1e5570bec8bb4f622d022b1a992b11ff17cc24d5 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Fri, 10 Jan 2025 00:31:53 +0100 Subject: [PATCH] Migrate from Guzzle to Symfony HttpClient - 5 --- composer-dependency-analyser.php | 6 - composer.json | 6 - composer.lock | 603 ++++--------------------------- 3 files changed, 73 insertions(+), 542 deletions(-) diff --git a/composer-dependency-analyser.php b/composer-dependency-analyser.php index 7a70a775e..e644e5633 100644 --- a/composer-dependency-analyser.php +++ b/composer-dependency-analyser.php @@ -28,8 +28,6 @@ return $config 'mnapoli/piwik-twig-extension', 'ocramius/proxy-manager', 'pagerfanta/twig', - 'php-http/client-common', - 'php-http/httplug', 'php-http/mock-client', 'phpstan/extension-installer', 'phpstan/phpstan', @@ -38,13 +36,11 @@ return $config 'phpstan/phpstan-symfony', 'psr/http-client', 'psr/http-factory', - 'psr/http-message', 'rulerz-php/doctrine-orm', 'scheb/2fa-qr-code', 'scheb/2fa-trusted-device', 'shipmonk/composer-dependency-analyser', 'symfony/asset', - 'symfony/browser-kit', 'symfony/css-selector', 'symfony/doctrine-bridge', 'symfony/google-mailer', @@ -58,10 +54,8 @@ return $config 'twig/string-extra', ], [ErrorType::UNUSED_DEPENDENCY]) ->ignoreErrorsOnPackages([ - 'guzzlehttp/streams', 'monolog/monolog', 'symfony/filesystem', - 'symfony/http-client', ], [ErrorType::PROD_DEPENDENCY_ONLY_IN_DEV]) ->ignoreErrorsOnPackages([ 'dama/doctrine-test-bundle', diff --git a/composer.json b/composer.json index df21af49f..155561d4b 100644 --- a/composer.json +++ b/composer.json @@ -75,9 +75,7 @@ "friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162", "friendsofsymfony/rest-bundle": "^3.6", "friendsofsymfony/user-bundle": "^3.2.1", - "guzzlehttp/guzzle": "^5.3.4", "guzzlehttp/psr7": "^2.6.2", - "guzzlehttp/streams": "^3.0", "html2text/html2text": "^4.3.1", "incenteev/composer-parameter-handler": "^2.2", "j0k3r/graby": "^2.4.5", @@ -99,10 +97,6 @@ "pagerfanta/twig": "^3.8", "php-amqplib/php-amqplib": "^3.6.1", "php-amqplib/rabbitmq-bundle": "^2.14.0", - "php-http/client-common": "^2.7.1", - "php-http/guzzle5-adapter": "^2.0", - "php-http/httplug": "^2.4", - "php-http/httplug-bundle": "^1.32", "pragmarx/recovery": "^0.2.1", "predis/predis": "^2.2.2", "psr/http-client": "^1.0.3", diff --git a/composer.lock b/composer.lock index c59a7c65c..ca8ba4dde 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5d0c837f0b291b94d75f9304994b997b", + "content-hash": "b86ffdcaaa721b479ed5e267901c4a63", "packages": [ { "name": "babdev/pagerfanta-bundle", @@ -2988,63 +2988,6 @@ }, "time": "2015-05-14T08:18:23+00:00" }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.4", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/5.3" - }, - "time": "2019-10-30T09:32:00+00:00" - }, { "name": "guzzlehttp/psr7", "version": "2.7.0", @@ -3161,117 +3104,6 @@ ], "time": "2024-07-18T11:15:46+00:00" }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "support": { - "issues": "https://github.com/guzzle/RingPHP/issues", - "source": "https://github.com/guzzle/RingPHP/tree/1.1.1" - }, - "abandoned": true, - "time": "2018-07-31T13:22:33+00:00" - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "support": { - "issues": "https://github.com/guzzle/streams/issues", - "source": "https://github.com/guzzle/streams/tree/master" - }, - "abandoned": true, - "time": "2014-10-12T19:18:40+00:00" - }, { "name": "hoa/compiler", "version": "3.17.08.08", @@ -6463,74 +6295,6 @@ }, "time": "2024-10-02T11:20:13+00:00" }, - { - "name": "php-http/guzzle5-adapter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/guzzle5-adapter.git", - "reference": "cce48360b1f8a3467bd94e853e6107aa4532008e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle5-adapter/zipball/cce48360b1f8a3467bd94e853e6107aa4532008e", - "reference": "cce48360b1f8a3467bd94e853e6107aa4532008e", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^5.1", - "php": "^7.0", - "php-http/discovery": "^1.0", - "php-http/httplug": "^2.0" - }, - "provide": { - "php-http/client-implementation": "1.0", - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "guzzlehttp/ringphp": "^1.1", - "php-http/client-integration-tests": "^2.0", - "phpunit/phpunit": "^6.0 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Adapter\\Guzzle5\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Guzzle 5 HTTP Adapter", - "homepage": "http://httplug.io", - "keywords": [ - "Guzzle", - "http" - ], - "support": { - "issues": "https://github.com/php-http/guzzle5-adapter/issues", - "source": "https://github.com/php-http/guzzle5-adapter/tree/2.0.0" - }, - "abandoned": "php-http/guzzle7-adapter", - "time": "2019-02-05T12:28:45+00:00" - }, { "name": "php-http/httplug", "version": "2.4.1", @@ -6588,169 +6352,6 @@ }, "time": "2024-09-23T11:39:58+00:00" }, - { - "name": "php-http/httplug-bundle", - "version": "1.34.3", - "source": { - "type": "git", - "url": "https://github.com/php-http/HttplugBundle.git", - "reference": "87c61d27c025dd9d699a2208a6d06be58061e433" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/HttplugBundle/zipball/87c61d27c025dd9d699a2208a6d06be58061e433", - "reference": "87c61d27c025dd9d699a2208a6d06be58061e433", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8.0", - "php-http/client-common": "^1.9 || ^2.0", - "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.14", - "php-http/httplug": "^2.0", - "php-http/logger-plugin": "^1.1", - "php-http/message": "^1.13", - "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 || ^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/cache-plugin": "<1.7.0", - "php-http/curl-client": "<2.0", - "php-http/guzzle6-adapter": "<1.1", - "php-http/socket-client": "<2.0", - "php-http/throttle-plugin": "<1.1" - }, - "require-dev": { - "guzzlehttp/psr7": "^1.7 || ^2.0", - "matthiasnoback/symfony-config-test": "^4.3 || ^5.0", - "matthiasnoback/symfony-dependency-injection-test": "^4.3.1 || ^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", - "phpunit/phpunit": "^9.6", - "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/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": { - "php-http/cache-plugin": "To configure clients that cache responses", - "php-http/mock-client": "Add this to your require-dev section to mock HTTP responses easily", - "twig/twig": "Add this to your require-dev section when using the WebProfilerBundle" - }, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "Http\\HttplugBundle\\": "src/" - }, - "exclude-from-classmap": [ - "/Tests/Resources/MyPsr18TestClient.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "David Buchmann", - "email": "mail@davidbu.ch" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "description": "Symfony integration for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "adapter", - "bundle", - "discovery", - "factory", - "http", - "httplug", - "message", - "php-http" - ], - "support": { - "issues": "https://github.com/php-http/HttplugBundle/issues", - "source": "https://github.com/php-http/HttplugBundle/tree/1.34.3" - }, - "time": "2024-09-01T08:25:40+00:00" - }, - { - "name": "php-http/logger-plugin", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/logger-plugin.git", - "reference": "bf47eb5cb379962d276c94da14861669c2313563" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/logger-plugin/zipball/bf47eb5cb379962d276c94da14861669c2313563", - "reference": "bf47eb5cb379962d276c94da14861669c2313563", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "php-http/client-common": "^1.9 || ^2.0", - "php-http/message": "^1.0", - "psr/log": "^1.0 || ^2 || ^3", - "symfony/polyfill-php73": "^1.17" - }, - "require-dev": { - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "PSR-3 Logger plugin for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "http", - "httplug", - "logger", - "plugin" - ], - "support": { - "issues": "https://github.com/php-http/logger-plugin/issues", - "source": "https://github.com/php-http/logger-plugin/tree/1.3.1" - }, - "time": "2024-09-01T06:51:51+00:00" - }, { "name": "php-http/message", "version": "1.16.2", @@ -6927,64 +6528,6 @@ }, "time": "2024-03-15T13:55:21+00:00" }, - { - "name": "php-http/stopwatch-plugin", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/stopwatch-plugin.git", - "reference": "11862cfbc719afade4ff407964ab3fbfe9ec2baa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/stopwatch-plugin/zipball/11862cfbc719afade4ff407964ab3fbfe9ec2baa", - "reference": "11862cfbc719afade4ff407964ab3fbfe9ec2baa", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8.0", - "php-http/client-common": "^1.9 || ^2.0", - "symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "require-dev": { - "guzzlehttp/psr7": "^2.1", - "symfony/phpunit-bridge": "^6.4.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Symfony Stopwatch plugin for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "http", - "httplug", - "plugin", - "stopwatch" - ], - "support": { - "issues": "https://github.com/php-http/stopwatch-plugin/issues", - "source": "https://github.com/php-http/stopwatch-plugin/tree/1.4.2" - }, - "time": "2023-12-05T14:36:57+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -8078,78 +7621,6 @@ }, "time": "2019-03-08T08:55:37+00:00" }, - { - "name": "react/promise", - "version": "v2.11.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831", - "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.11.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-11-16T16:16:50+00:00" - }, { "name": "rulerz-php/doctrine-orm", "version": "dev-master", @@ -18535,6 +18006,78 @@ ], "time": "2023-11-13T13:48:05+00:00" }, + { + "name": "react/promise", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831", + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.11.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-16T16:16:50+00:00" + }, { "name": "react/socket", "version": "v1.16.0",