1 | <?php |
||
19 | abstract class AbstractDocument implements DocumentInterface |
||
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 | 5 | public function __construct(Client $client) |
|
36 | |||
37 | /** |
||
38 | * get |
||
39 | * |
||
40 | * @param string $endpoint |
||
41 | * |
||
42 | * @return \Psr\Http\Message\ResponseInterface |
||
43 | */ |
||
44 | 12 | 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 | 3 | 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 | 3 | 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 | 3 | protected function patch($endpoint, array $body = []) |
|
99 | |||
100 | /** |
||
101 | * delete |
||
102 | * |
||
103 | * @param string $endpoint |
||
104 | * |
||
105 | * @return \Psr\Http\Message\ResponseInterface |
||
106 | */ |
||
107 | 4 | protected function delete($endpoint, array $body = []) |
|
115 | } |
||
116 |