Skip to content

Commit 25893fe

Browse files
Remove usage of deprecated class HttplugFactory (#20)
1 parent 1078414 commit 25893fe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": "^7.3 || ^8.0",
2020
"nyholm/psr7": "^1.0",
21+
"php-http/curl-client": "^2.2",
2122
"php-http/mock-client": "^1.2",
2223
"phpunit/phpunit": "^9.5",
2324
"psr/http-client": "^1.0"

src/CachedResponseClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
namespace Geocoder\IntegrationTest;
1212

13-
use Nyholm\Psr7\Factory\HttplugFactory;
1413
use Nyholm\Psr7\Response;
14+
use Nyholm\Psr7\Stream;
1515
use Psr\Http\Client\ClientInterface;
1616
use Psr\Http\Message\RequestInterface;
1717
use Psr\Http\Message\ResponseInterface;
@@ -76,7 +76,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface
7676

7777
$file = sprintf('%s/%s_%s', $this->cacheDir, $host, sha1($cacheKey));
7878
if (is_file($file) && is_readable($file) && ($content = file_get_contents($file)) !== false) {
79-
return new Response(200, [], (new HttplugFactory())->createStream(unserialize($content)));
79+
return new Response(200, [], Stream::create(unserialize($content)));
8080
}
8181

8282
$response = $this->delegate->sendRequest($request);

0 commit comments

Comments
 (0)