1 | <?php |
||
16 | class Api |
||
17 | { |
||
18 | /** |
||
19 | * @var Client |
||
20 | */ |
||
21 | protected Client $client; |
||
|
|||
22 | /** |
||
23 | * @var ResponseTransformer |
||
24 | */ |
||
25 | protected ResponseTransformer $transformer; |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private string $version = 'v3'; |
||
30 | 29 | /** |
|
31 | * @var string |
||
32 | 29 | */ |
|
33 | 29 | private string $endpoint = '/'; |
|
34 | 29 | ||
35 | /** |
||
36 | * Api constructor. |
||
37 | * @param Client $client |
||
38 | */ |
||
39 | public function __construct(Client $client) |
||
40 | { |
||
41 | $this->client = $client; |
||
42 | $this->transformer = new ResponseTransformer(); |
||
43 | } |
||
44 | |||
45 | 26 | /** |
|
46 | * @param string $method |
||
47 | 26 | * @param string $uri |
|
48 | 26 | * @param array $options |
|
49 | 2 | * @param bool|null $needSequence |
|
50 | * @return array |
||
51 | 24 | * @throws GuzzleException |
|
52 | * @throws TransformResponseException |
||
53 | 1 | */ |
|
54 | public function rest(string $method, string $uri, array $options = [], ?bool $needSequence = null): array |
||
62 | } |