Skip to content

Commit

Permalink
Merge pull request #26 from TransitScreen/add_guzzle_psr7_2_support
Browse files Browse the repository at this point in the history
Switch to guzzlehttp/psr7:^2.2.1 and use its official HTTP factories
  • Loading branch information
ethanpooley authored Apr 29, 2022
2 parents d63d62c + 49e7738 commit 15d0b66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
],
"require": {
"php": "^7.3||^8.0",
"guzzlehttp/psr7": "^1.0",
"guzzlehttp/psr7": "^2.0",
"php-http/message": "^1.5",
"php-http/curl-client": "^2.1",
"psr/http-message": "^1.0",
"http-interop/http-factory-guzzle": "^1.0"
"psr/http-message": "^1.0"
},
"require-dev": {
"php-http/mock-client": "^1.0",
Expand Down
7 changes: 3 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace HerokuClient;

use GuzzleHttp\Psr7\HttpFactory;
use GuzzleHttp\Psr7\Request;
use HerokuClient\Exception\BadHttpStatusException;
use HerokuClient\Exception\JsonDecodingException;
use HerokuClient\Exception\JsonEncodingException;
use HerokuClient\Exception\MissingApiKeyException;
use Http\Client\Curl\Client as CurlHttpClient;
use Http\Client\HttpClient;
use Http\Factory\Guzzle\ResponseFactory;
use Http\Factory\Guzzle\StreamFactory;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -269,8 +268,8 @@ protected function processResponse(ResponseInterface $httpResponse)
protected function buildHttpClient()
{
return new CurlHttpClient(
new ResponseFactory(),
new StreamFactory(),
new HttpFactory(),
new HttpFactory(),
$this->curlOptions
);
}
Expand Down

0 comments on commit 15d0b66

Please sign in to comment.