| 1 |
<?php |
| 2 |
|
| 3 |
namespace Google\Auth\HttpHandler; |
| 4 |
|
| 5 |
use GuzzleHttp\ClientInterface; |
| 6 |
use Psr\Http\Message\RequestInterface; |
| 7 |
use Psr\Http\Message\ResponseInterface; |
| 8 |
|
| 9 |
class Guzzle6HttpHandler |
| 10 |
{ |
| 11 |
/** |
| 12 |
* @var ClientInterface |
| 13 |
*/ |
| 14 |
private $client; |
| 15 |
|
| 16 |
/** |
| 17 |
* @param ClientInterface $client |
| 18 |
*/ |
| 19 |
public function __construct(ClientInterface $client) |
| 20 |
{ |
| 21 |
$this->client = $client; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Accepts a PSR-7 request and an array of options and returns a PSR-7 response. |
| 26 |
* |
| 27 |
* @param RequestInterface $request |
| 28 |
* @param array $options |
| 29 |
* @return ResponseInterface |
| 30 |
*/ |
| 31 |
public function __invoke(RequestInterface $request, array $options = []) |
| 32 |
{ |
| 33 |
return $this->client->send($request, $options); |
| 34 |
} |
| 35 |
} |
| 36 |
|