Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cache:
- $HOME/.composer/cache/files

php:
- 7.1
- 7.2
- 7.3
- 7.4
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Recorder/FilesystemRecorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,15 +74,15 @@ 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
{
$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.');
}

Expand Down