Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 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
     *
30
     * @return ResponseInterface
31
     */
32
    public function __invoke(RequestInterface $request, array $options = [])
33
    {
34
        return $this->client->send($request, $options);
35
    }
36
}