1 | <?php |
||
15 | abstract class AbstractClient |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | const METHOD_GET = 'GET'; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | const METHOD_POST = 'POST'; |
||
26 | |||
27 | /** |
||
28 | * @var RequestFactory |
||
29 | */ |
||
30 | protected $requestFactory; |
||
31 | |||
32 | /** |
||
33 | * @var HttpClientInterface |
||
34 | */ |
||
35 | protected $httpClient; |
||
36 | |||
37 | /** |
||
38 | * Constructs a new Cloudstack client instance. |
||
39 | * |
||
40 | * @param array $options |
||
41 | * An array of options to set on this client. |
||
42 | * @param array $collaborators |
||
43 | * An array of collaborators that may be used to override |
||
44 | * this provider's default behavior. Collaborators include |
||
45 | * `requestFactory` and `httpClient`. |
||
46 | */ |
||
47 | public function __construct(array $options = [], array $collaborators = []) |
||
63 | |||
64 | /** |
||
65 | * Return the list of options that can be passed to the HttpClient |
||
66 | * |
||
67 | * @param array $options |
||
68 | * @return array |
||
69 | */ |
||
70 | protected function getAllowedClientOptions(array $options) : array |
||
81 | |||
82 | /** |
||
83 | * Returns a PSR-7 request instance that is not authenticated. |
||
84 | * |
||
85 | * @param string $method |
||
86 | * @param string $url |
||
87 | * @param array $options |
||
88 | * @return RequestInterface |
||
89 | */ |
||
90 | public function getRequest(string $method, string $url, array $options = []) : RequestInterface |
||
94 | |||
95 | /** |
||
96 | * Creates a PSR-7 request instance. |
||
97 | * |
||
98 | * @param string $method |
||
99 | * @param string $url |
||
100 | * @param array $options |
||
101 | * @return RequestInterface |
||
102 | */ |
||
103 | protected function createRequest(string $method, string $url, array $options) : RequestInterface |
||
109 | |||
110 | /** |
||
111 | * Sends a request instance and returns a response instance. |
||
112 | * |
||
113 | * @param RequestInterface $request |
||
114 | * @return ResponseInterface |
||
115 | */ |
||
116 | protected function sendRequest(RequestInterface $request) : ResponseInterface |
||
126 | |||
127 | /** |
||
128 | * Sends a request and returns the parsed response. |
||
129 | * |
||
130 | * @param RequestInterface $request |
||
131 | * @return mixed |
||
132 | */ |
||
133 | public function getResponse(RequestInterface $request) |
||
142 | |||
143 | /** |
||
144 | * Attempts to parse a JSON response. |
||
145 | * |
||
146 | * @param string $content |
||
147 | * @return array |
||
148 | * @throws UnexpectedValueException |
||
149 | */ |
||
150 | protected function parseJson(string $content) : array |
||
163 | |||
164 | /** |
||
165 | * Returns the content type header of a response. |
||
166 | * |
||
167 | * @param ResponseInterface $response |
||
168 | * @return string |
||
169 | */ |
||
170 | protected function getContentType(ResponseInterface $response) : string |
||
174 | |||
175 | /** |
||
176 | * Parses the response according to its content-type header. |
||
177 | * |
||
178 | * @param ResponseInterface $response |
||
179 | * @return mixed |
||
180 | * @throws UnexpectedValueException |
||
181 | */ |
||
182 | protected function parseResponse(ResponseInterface $response) |
||
205 | |||
206 | /** |
||
207 | * Checks a provider response for errors. |
||
208 | * |
||
209 | * @param ResponseInterface $response |
||
210 | * @param array|string $data |
||
211 | * @return void |
||
212 | * @throws \PCextreme\Cloudstack\Exception\ClientException |
||
213 | */ |
||
214 | abstract protected function checkResponse(ResponseInterface $response, $data); |
||
215 | |||
216 | /** |
||
217 | * Sets the request factory instance. |
||
218 | * |
||
219 | * @param RequestFactory $factory |
||
220 | * @return self |
||
221 | */ |
||
222 | public function setRequestFactory(RequestFactory $factory) : self |
||
228 | |||
229 | /** |
||
230 | * Returns the request factory instance. |
||
231 | * |
||
232 | * @return RequestFactory |
||
233 | */ |
||
234 | public function getRequestFactory() : RequestFactory |
||
238 | |||
239 | /** |
||
240 | * Sets the HTTP client instance. |
||
241 | * |
||
242 | * @param HttpClientInterface $client |
||
243 | * @return self |
||
244 | */ |
||
245 | public function setHttpClient(HttpClientInterface $client) : self |
||
251 | |||
252 | /** |
||
253 | * Returns the HTTP client instance. |
||
254 | * |
||
255 | * @return HttpClientInterface |
||
256 | */ |
||
257 | public function getHttpClient() : HttpClientInterface |
||
261 | } |
||
262 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.