1 | <?php |
||
14 | class OrtcClient |
||
15 | { |
||
16 | /** |
||
17 | * @var \GuzzleHttp\Client |
||
18 | */ |
||
19 | protected $guzzleClient; |
||
20 | |||
21 | /** |
||
22 | * @var OrtcRequest |
||
23 | */ |
||
24 | protected $request; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $baseUrl; |
||
30 | |||
31 | /** |
||
32 | * execute single request. |
||
33 | * |
||
34 | * @throws UnauthorizedException |
||
35 | * @throws NetworkErrorException |
||
36 | * @throws InvalidBalancerUrlException |
||
37 | * |
||
38 | * @return Models\Responses\OrtcResponse |
||
39 | */ |
||
40 | public function execute() |
||
64 | |||
65 | /** |
||
66 | * execute batch requests (post). |
||
67 | * |
||
68 | * @throws BatchRequestException |
||
69 | * |
||
70 | * @return Models\Responses\OrtcResponse |
||
71 | */ |
||
72 | public function batchExecute() |
||
91 | |||
92 | /** |
||
93 | * @param \GuzzleHttp\Client $guzzleClient |
||
94 | */ |
||
95 | public function setGuzzleClient($guzzleClient) |
||
99 | |||
100 | /** |
||
101 | * @param OrtcRequest $request |
||
102 | */ |
||
103 | public function setRequest($request) |
||
107 | |||
108 | /** |
||
109 | * @param string $baseUrl |
||
110 | */ |
||
111 | public function setBaseUrl($baseUrl) |
||
115 | |||
116 | /** |
||
117 | * get request options for post requests. |
||
118 | * |
||
119 | * @param array $postData |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | protected function getRequestOptionsForPost($postData) |
||
130 | |||
131 | /** |
||
132 | * get request options for get requests. |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | protected function getRequestOptionsForGet() |
||
142 | |||
143 | /** |
||
144 | * create guzzle GET/POST request. |
||
145 | * |
||
146 | * @return \Psr\Http\Message\RequestInterface |
||
147 | */ |
||
148 | protected function createRequest() |
||
164 | |||
165 | /** |
||
166 | * create batch guzzle POST requests. |
||
167 | * |
||
168 | * @return \GuzzleHttp\Message\Request[] |
||
169 | */ |
||
170 | protected function createBatchPostRequests() |
||
184 | |||
185 | /** |
||
186 | * combine path url & baseUrl if needed! |
||
187 | */ |
||
188 | protected function getRequestUrl() |
||
196 | } |
||
197 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.