From e20f109ee7f35f159320723584d1312c6ba15036 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sat, 21 Nov 2020 18:33:59 +0100 Subject: [PATCH] Bump minimum versions (#12) --- .travis.yml | 3 +-- composer.json | 4 ++-- src/Recorder/FilesystemRecorder.php | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1ad346..7ee1f9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ cache: - $HOME/.composer/cache/files php: - - 7.1 - 7.2 - 7.3 - 7.4 @@ -23,7 +22,7 @@ branches: matrix: fast_finish: true include: - - php: 7.1 + - php: 7.2 env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - php: 7.4 env: COMPOSER_FLAGS="--prefer-stable" COVERAGE=true TEST_COMMAND="composer test-ci" diff --git a/composer.json b/composer.json index 7089b70..6f60d01 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ } ], "require": { - "php": "^7.1", - "guzzlehttp/psr7": "^1.4", + "php": "^7.2", + "guzzlehttp/psr7": "^1.7", "php-http/client-common": "^2.0", "psr/log": "^1.1", "symfony/filesystem": "^3.4|^4.0|^5.0", diff --git a/src/Recorder/FilesystemRecorder.php b/src/Recorder/FilesystemRecorder.php index 4bc2814..f3455c6 100644 --- a/src/Recorder/FilesystemRecorder.php +++ b/src/Recorder/FilesystemRecorder.php @@ -4,7 +4,7 @@ namespace Http\Client\Plugin\Vcr\Recorder; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\Message; use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; @@ -74,7 +74,7 @@ public function replay(string $name): ?ResponseInterface throw new \RuntimeException(sprintf('Unable to read "%s" file content', $filename)); } - return Psr7\parse_response($content); + return Message::parseResponse($content); } public function record(string $name, ResponseInterface $response): void @@ -82,7 +82,7 @@ public function record(string $name, ResponseInterface $response): void $filename = "{$this->directory}$name.txt"; $context = compact('name', 'filename'); - if (null === $content = preg_replace(array_keys($this->filters), array_values($this->filters), Psr7\str($response))) { + if (null === $content = preg_replace(array_keys($this->filters), array_values($this->filters), Message::toString($response))) { throw new \RuntimeException('Some of the provided response filters are invalid.'); }