1 | <?php |
||
14 | class GuzzleAdapter implements AsyncClientInterface |
||
15 | { |
||
16 | /** |
||
17 | * The Guzzle client. |
||
18 | * |
||
19 | * @author Andrea Marco Sartori |
||
20 | * @var GuzzleHttp\ClientInterface |
||
21 | */ |
||
22 | protected $client; |
||
23 | |||
24 | /** |
||
25 | * Set the dependencies. |
||
26 | * |
||
27 | * @author Andrea Marco Sartori |
||
28 | * @param GuzzleHttp\ClientInterface $client |
||
29 | * @return void |
||
|
|||
30 | */ |
||
31 | public function __construct(Guzzle $client) |
||
35 | |||
36 | /** |
||
37 | * Process the HTTP request synchronously. |
||
38 | * |
||
39 | * @author Andrea Marco Sartori |
||
40 | * @param string $verb |
||
41 | * @param string $endpoint |
||
42 | * @param array $options |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function call($verb, $endpoint, array $options = []) |
||
49 | |||
50 | /** |
||
51 | * Process the HTTP request asynchronously. |
||
52 | * |
||
53 | * @author Andrea Marco Sartori |
||
54 | * @param string $verb |
||
55 | * @param string $endpoint |
||
56 | * @param array $options |
||
57 | * @param Closure $success |
||
58 | * @param Closure|null $failure |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function then($verb, $endpoint, array $options = [], Closure $success, Closure $failure = null) |
||
65 | |||
66 | /** |
||
67 | * Retrieve the query string parameters from the given options. |
||
68 | * |
||
69 | * @param array $options |
||
70 | * @return array |
||
71 | */ |
||
72 | public function getQueryByOptions(array $options) |
||
76 | } |
||
77 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.