1 | <?php |
||
19 | class AbstractApi implements ApiInterface |
||
20 | { |
||
21 | /** |
||
22 | * client |
||
23 | * @var \Unikorp\KongAdminApi\Client $client |
||
24 | */ |
||
25 | private $client = null; |
||
26 | |||
27 | /** |
||
28 | * Constructor |
||
29 | * |
||
30 | * @param \Unikorp\KongAdminApi\Client $client |
||
31 | */ |
||
32 | public function __construct(Client $client) |
||
36 | |||
37 | /** |
||
38 | * get |
||
39 | * |
||
40 | * @param string $endpoint |
||
41 | * |
||
42 | * @return \Psr\Http\Message\ResponseInterface |
||
43 | */ |
||
44 | protected function get($endpoint) |
||
48 | |||
49 | /** |
||
50 | * post |
||
51 | * |
||
52 | * @param string $endpoint |
||
53 | * @param array $body |
||
54 | * |
||
55 | * @return \Psr\Http\Message\ResponseInterface |
||
56 | */ |
||
57 | protected function post($endpoint, array $body = []) |
||
65 | |||
66 | /** |
||
67 | * put |
||
68 | * |
||
69 | * @param string $endpoint |
||
70 | * @param array $body |
||
71 | * |
||
72 | * @return \Psr\Http\Message\ResponseInterface |
||
73 | */ |
||
74 | protected function put($endpoint, array $body = []) |
||
82 | |||
83 | /** |
||
84 | * patch |
||
85 | * |
||
86 | * @param string $endpoint |
||
87 | * @param array $body |
||
88 | * |
||
89 | * @return \Psr\Http\Message\ResponseInterface |
||
90 | */ |
||
91 | protected function patch($endpoint, array $body = []) |
||
99 | |||
100 | /** |
||
101 | * delete |
||
102 | * |
||
103 | * @param string $endpoint |
||
104 | * @param array $body |
||
105 | * |
||
106 | * @return \Psr\Http\Message\ResponseInterface |
||
107 | */ |
||
108 | protected function delete($endpoint, array $body = []) |
||
116 | } |
||
117 |