1 | <?php |
||
21 | abstract class AbstractTransport implements TransportInterface |
||
22 | { |
||
23 | /** |
||
24 | * List of cURL options. |
||
25 | * |
||
26 | * @var OptionInterface[] |
||
27 | */ |
||
28 | protected $options = []; |
||
29 | |||
30 | /** |
||
31 | * Retrieve added cURL options. |
||
32 | * |
||
33 | * @return OptionInterface[] |
||
34 | */ |
||
35 | public function getOptions() |
||
39 | |||
40 | /** |
||
41 | * Set cURL options. |
||
42 | * |
||
43 | * @param array $options |
||
44 | * |
||
45 | * @throws OptionException |
||
46 | */ |
||
47 | public function setOptions(array $options) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | * |
||
57 | * @throws OptionException |
||
58 | */ |
||
59 | public function setOption($option, $value = '', $quiet = false) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | * |
||
78 | * @param int|string|OptionInterface $option |
||
79 | * @param mixed $value |
||
80 | */ |
||
81 | public function hasOption($option, $value = null) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | * |
||
105 | * @param int|string|OptionInterface $option |
||
106 | */ |
||
107 | public function removeOption($option) |
||
130 | |||
131 | /** |
||
132 | * Shorthand for OPTIONS cURL request. |
||
133 | * |
||
134 | * @param string $uri |
||
135 | * @param array $headers |
||
136 | * @param string|null $requestBody |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function options($uri, array $headers = [], $requestBody = null) |
||
144 | |||
145 | /** |
||
146 | * Shorthand for HEAD cURL request. |
||
147 | * |
||
148 | * @param string $uri |
||
149 | * @param array $headers |
||
150 | * @param string|null $requestBody |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function head($uri, array $headers = [], $requestBody = null) |
||
158 | |||
159 | /** |
||
160 | * Shorthand for GET cURL request. |
||
161 | * |
||
162 | * @param string $uri |
||
163 | * @param array $headers |
||
164 | * @param string|null $requestBody |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | public function get($uri, array $headers = [], $requestBody = null) |
||
172 | |||
173 | /** |
||
174 | * Shorthand for POST cURL request. |
||
175 | * |
||
176 | * @param string $uri |
||
177 | * @param array $headers |
||
178 | * @param string|null $requestBody |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | public function post($uri, array $headers = [], $requestBody = null) |
||
186 | |||
187 | /** |
||
188 | * Shorthand for PUT cURL request. |
||
189 | * |
||
190 | * @param string $uri |
||
191 | * @param array $headers |
||
192 | * @param string|null $requestBody |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | public function put($uri, array $headers = [], $requestBody = null) |
||
200 | |||
201 | /** |
||
202 | * Shorthand for DELETE cURL request. |
||
203 | * |
||
204 | * @param string $uri |
||
205 | * @param array $headers |
||
206 | * @param string|null $requestBody |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | public function delete($uri, array $headers = [], $requestBody = null) |
||
214 | |||
215 | /** |
||
216 | * Shorthand for PATCH cURL request. |
||
217 | * |
||
218 | * @param string $uri |
||
219 | * @param array $headers |
||
220 | * @param string|null $requestBody |
||
221 | * |
||
222 | * @return string |
||
223 | */ |
||
224 | public function patch($uri, array $headers = [], $requestBody = null) |
||
228 | } |
||
229 |