1 | <?php |
||
26 | class GuzzleClient implements ClientInterface |
||
27 | { |
||
28 | const GUZZLE_THREE_CLIENT_CLASS = 'Guzzle\Http\Client'; |
||
29 | const GUZZLE_CLIENT_CLASS = 'GuzzleHttp\Client'; |
||
30 | |||
31 | /** @var string|null */ |
||
32 | protected $guzzleVersion = null; |
||
33 | /** @var \GuzzleHttp\Client|\Guzzle\Http\Client */ |
||
34 | protected $guzzle; |
||
35 | /** @var RequestBuilder */ |
||
36 | protected $requestBuilder; |
||
37 | |||
38 | /** |
||
39 | * @param \GuzzleHttp\Client|\Guzzle\Http\Client $guzzleClient |
||
40 | * @throw BadMethodCallException |
||
41 | */ |
||
42 | public function __construct($guzzleClient = null) |
||
58 | |||
59 | /** |
||
60 | * @return \Guzzle\Http\Client|\GuzzleHttp\Client |
||
61 | */ |
||
62 | public function getGuzzleClient() |
||
66 | |||
67 | /** |
||
68 | * Check if class available |
||
69 | * |
||
70 | * @param string $className |
||
71 | * @param bool $throwException |
||
72 | * @throw BadMethodCallException |
||
73 | * @return bool |
||
74 | */ |
||
75 | protected function checkClassExists($className, $throwException = true) |
||
89 | |||
90 | /** |
||
91 | * Set Guzzle client version |
||
92 | * |
||
93 | * @param $version string |
||
94 | */ |
||
95 | public function setVersion($version) |
||
99 | |||
100 | /** |
||
101 | * @param RequestInterface $request |
||
102 | * @return ResponseInterface |
||
103 | * @throws \Exception |
||
104 | */ |
||
105 | public function send(RequestInterface $request) |
||
126 | } |
||
127 |