1 | <?php |
||
14 | class Client |
||
15 | { |
||
16 | /** |
||
17 | * Base URI. |
||
18 | */ |
||
19 | const BASE_URI = 'https://api.cloudflare.com/client/v4/'; |
||
20 | |||
21 | /** |
||
22 | * @var \GuzzleHttp\ClientInterface |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | /** |
||
27 | * @var \Illuminate\Contracts\Logging\Log |
||
28 | */ |
||
29 | protected $logger; |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | * |
||
34 | * @param \GuzzleHttp\ClientInterface $client |
||
35 | * @param \Illuminate\Contracts\Logging $logger |
||
36 | */ |
||
37 | public function __construct(ClientInterface $client, Log $logger) |
||
42 | |||
43 | /** |
||
44 | * Delete all the given zones with their options. |
||
45 | * |
||
46 | * All the requests are asynchronous and sent concurrently. |
||
47 | * |
||
48 | * The promise waits until all the promises have been resolved or rejected |
||
49 | * and returns the results of each request. |
||
50 | * |
||
51 | * @param \Illuminate\Support\Collection $zones |
||
52 | * @return \Illuminate\Support\Collection |
||
53 | */ |
||
54 | public function purge(Collection $zones) |
||
64 | |||
65 | /** |
||
66 | * Returns a promise that is fulfilled when all of the provided promises have |
||
67 | * been fulfilled or rejected. |
||
68 | * |
||
69 | * The returned promise is fulfilled with a collection of results. |
||
70 | * |
||
71 | * @param Illuminate\Support\Collection $promises |
||
72 | * @return GuzzleHttp\Promise\PromiseInterface |
||
73 | */ |
||
74 | protected function settle(Collection $promises) |
||
86 | |||
87 | /** |
||
88 | * Put the body of the fulfilled promise into the results. |
||
89 | * |
||
90 | * @param \Illuminate\Support\Collection $results |
||
91 | * @return Closure |
||
92 | */ |
||
93 | protected function onFulfilled(Collection &$results) |
||
99 | |||
100 | /** |
||
101 | * Handle the rejected promise and put the errors into the results. |
||
102 | * |
||
103 | * @param \Illuminate\Support\Collection $results |
||
104 | * @return Closure |
||
105 | */ |
||
106 | protected function onRejected(Collection &$results) |
||
118 | |||
119 | /** |
||
120 | * Transform a request exception into a response object. |
||
121 | * |
||
122 | * @param \GuzzleHttp\Exception\RequestException $e |
||
123 | * @return object |
||
124 | */ |
||
125 | protected function handleException(RequestException $e) |
||
145 | |||
146 | /** |
||
147 | * Get the response body. |
||
148 | * |
||
149 | * @param \GuzzleHttp\Psr7\Response $response |
||
150 | * @return object |
||
151 | */ |
||
152 | protected function getBody(Response $response) |
||
156 | |||
157 | /** |
||
158 | * Get the Guzzle client. |
||
159 | * |
||
160 | * @return \GuzzleHttp\Client |
||
161 | */ |
||
162 | public function getClient() |
||
166 | } |
||
167 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: