From 351dfde5b402ec3a1ae7a782b8c21d64d7fcfc11 Mon Sep 17 00:00:00 2001 From: Ruin0x11 Date: Fri, 18 Jun 2021 08:55:57 -0700 Subject: [PATCH] Use Guzzle PSR-18 wrapper for TMDB API client This is because Symfony's client is incompatible with PHP-VCR. https://github.com/php-vcr/php-vcr/issues/329 --- composer.json | 1 + composer.lock | 62 ++++++++++++++++++++++++++++++++++++++- config/packages/tmdb.yaml | 6 ++-- symfony.lock | 3 ++ 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4fead82..0dd54cf 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "ext-iconv": "*", "ext-json": "*", "alanly/traktor": "dev-master", + "alextartan/guzzle-psr18-adapter": "^4.0", "enqueue/dbal": "^0.10", "enqueue/enqueue-bundle": "^0.10", "friendsofsymfony/elastica-bundle": "^5.2", diff --git a/composer.lock b/composer.lock index 2b584bb..e8985f9 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": "9da767d3fbbcfab5aff209a6dbfbca8c", + "content-hash": "21d62ab5dd359adef03f0114f615efc3", "packages": [ { "name": "alanly/traktor", @@ -44,6 +44,66 @@ "homepage": "https://github.com/alanly/traktor", "time": "2021-06-18T10:17:57+00:00" }, + { + "name": "alextartan/guzzle-psr18-adapter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/alextartan/guzzle-psr18-adapter.git", + "reference": "2dc27e34e1ea20fcccbc3447d0a9d42f8249e87a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/alextartan/guzzle-psr18-adapter/zipball/2dc27e34e1ea20fcccbc3447d0a9d42f8249e87a", + "reference": "2dc27e34e1ea20fcccbc3447d0a9d42f8249e87a", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7", + "php": ">=7.4||>=8.0", + "psr/http-client": "^1.0.0", + "psr/http-message": "^1.0.0" + }, + "require-dev": { + "ext-mbstring": "*", + "ext-xml": "*", + "infection/infection": "^0.20", + "php-coveralls/php-coveralls": "^2.4", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^9", + "roave/security-advisories": "dev-master", + "squizlabs/php_codesniffer": "3.5.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "AlexTartan\\GuzzlePsr18Adapter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Alex Tartan", + "email": "alex.tartan@gmail.com" + } + ], + "description": "Lightweight wrapper over Guzzle to comply with PSR18", + "keywords": [ + "Guzzle", + "adapter", + "psr18" + ], + "support": { + "issues": "https://github.com/alextartan/guzzle-psr18-adapter/issues", + "source": "https://github.com/alextartan/guzzle-psr18-adapter/tree/4.0.4" + }, + "time": "2021-01-01T00:13:59+00:00" + }, { "name": "brick/math", "version": "0.9.2", diff --git a/config/packages/tmdb.yaml b/config/packages/tmdb.yaml index a929edb..83b2738 100644 --- a/config/packages/tmdb.yaml +++ b/config/packages/tmdb.yaml @@ -8,7 +8,7 @@ tmdb_symfony: adapter: Symfony\Component\EventDispatcher\EventDispatcher secure: false http: - client: Symfony\Component\HttpClient\Psr18Client + client: AlexTartan\GuzzlePsr18Adapter\Client request_factory: Nyholm\Psr7\Factory\Psr17Factory response_factory: Nyholm\Psr7\Factory\Psr17Factory stream_factory: Nyholm\Psr7\Factory\Psr17Factory @@ -17,8 +17,8 @@ tmdb_symfony: enabled: false services: - Symfony\Component\HttpClient\Psr18Client: - class: Symfony\Component\HttpClient\Psr18Client + AlexTartan\GuzzlePsr18Adapter\Client: + class: AlexTartan\GuzzlePsr18Adapter\Client Nyholm\Psr7\Factory\Psr17Factory: class: Nyholm\Psr7\Factory\Psr17Factory diff --git a/symfony.lock b/symfony.lock index d14fe3b..bd168a8 100644 --- a/symfony.lock +++ b/symfony.lock @@ -2,6 +2,9 @@ "alanly/traktor": { "version": "dev-master" }, + "alextartan/guzzle-psr18-adapter": { + "version": "4.0.4" + }, "amphp/amp": { "version": "v2.5.2" },