-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAbstractClient.php
44 lines (38 loc) · 1.15 KB
/
AbstractClient.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Xe\Framework\Client\BaseClient;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
abstract class AbstractClient
{
protected $client = null;
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
/**
* Send an HTTP request.
*
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given request and to the transfer
*
* @return ResponseInterface
*/
protected function send(RequestInterface $request, array $options = [])
{
return $this->client->send($request, $options);
}
/**
* Send an HTTP request.
*
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given request and to the transfer
*
* @return PromiseInterface
*/
protected function sendAsync(RequestInterface $request, array $options = [])
{
return $this->client->sendAsync($request, $options);
}
}