1 | <?php |
||
11 | final class Client |
||
12 | { |
||
13 | private $accessToken; |
||
14 | |||
15 | private $currentTeam; |
||
16 | |||
17 | private $httpClient; |
||
18 | |||
19 | private $apiMethods; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $httpOptions = [ |
||
25 | 'base_uri' => 'https://api.esa.io/v1/', |
||
26 | 'timeout' => 60, |
||
27 | 'allow_redirect' => false, |
||
28 | 'headers' => [ |
||
29 | 'User-Agent' => 'esa-php-api v1', |
||
30 | 'Accept' => 'application/json', |
||
31 | ], |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * @param $accessToken |
||
36 | * @param $currentTeam |
||
37 | * @param HttpClientInterface $httpClient |
||
38 | * @param array $httpOptions |
||
39 | */ |
||
40 | public function __construct($accessToken, $currentTeam, HttpClientInterface $httpClient = null, $httpOptions = []) |
||
53 | |||
54 | public function __call($name, $args) |
||
62 | |||
63 | private function createAuthStack() |
||
72 | } |
||
73 |