1 | <?php |
||
12 | class Client |
||
13 | { |
||
14 | const LOCATION = 'https://vrapi.verticalresponse.com/api/v1/'; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $accessToken; |
||
20 | |||
21 | /** |
||
22 | * @var RequestProviderInterface |
||
23 | */ |
||
24 | private $requestProvider; |
||
25 | |||
26 | /** |
||
27 | * @var HttpClientInterface |
||
28 | */ |
||
29 | private $client; |
||
30 | |||
31 | /** |
||
32 | * Client constructor. |
||
33 | * |
||
34 | * @param string $accessToken |
||
35 | * @param HttpClientInterface|null $client |
||
36 | * @param RequestProviderInterface|null $requestProvider |
||
37 | */ |
||
38 | public function __construct( |
||
53 | |||
54 | /** |
||
55 | * @param string $url |
||
56 | * @param array $parameters |
||
57 | * |
||
58 | * @return \stdClass |
||
59 | * @throws Exception |
||
60 | * @throws HttpException |
||
61 | */ |
||
62 | public function get($url, $parameters = []) |
||
76 | |||
77 | /** |
||
78 | * @param string $url |
||
79 | * @param array $parameters |
||
80 | * |
||
81 | * @return \stdClass |
||
82 | * @throws Exception |
||
83 | * @throws HttpException |
||
84 | */ |
||
85 | public function post($url, $parameters = []) |
||
97 | |||
98 | /** |
||
99 | * @param string $url |
||
100 | * @param array $parameters |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | protected function buildQuery($url, $parameters) |
||
108 | |||
109 | /** |
||
110 | * @return string[] |
||
111 | */ |
||
112 | protected function buildHeaders() |
||
119 | |||
120 | /** |
||
121 | * @param ResponseInterface $response |
||
122 | * |
||
123 | * @return void |
||
124 | * @throws Exception |
||
125 | * @throws HttpException |
||
126 | */ |
||
127 | protected function errorCheckResponse(ResponseInterface $response) |
||
144 | |||
145 | /** |
||
146 | * @param StreamInterface $stream |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | protected function streamToString(StreamInterface $stream) |
||
155 | |||
156 | /** @return string */ |
||
157 | public function getLocation() |
||
161 | } |
||
162 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.