-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make possibility to extend CurlClient #1088
Make possibility to extend CurlClient #1088
Conversation
@masterjus Thanks for the PR! We'll have a look and get back to you if we need more changes! |
Hi @masterjus, thanks for the submission. This seems reasonable to me but I don't want to merge without some idea of how concretely this would be used. Would you mind writing a little bit about your use case and the context for extending CurlClient? |
Hi @masterjus, closing for now but feel free to reopen if you can explain some more about the use case for this. |
We have our own API which communicates with the Stripe's API and we want to log every request/response to Stripe. So we have overridden method <?php
public function request($method, $absUrl, $headers, $params, $hasFile)
{
$this->logger()->logRequest(collect([
'method' => $method,
'url' => $absUrl,
'headers' => $headers,
'body' => $params,
]));
list($response['body'], $response['code'], $response['headers']) =
parent::request($method, $absUrl, $headers, $params, $hasFile);
$this->logger()->logResponse(collect($response));
return array_values($response);
} If there will be some events which I could listen to, it would be awesome. |
@richardm-stripe, could you please restart checks? Previous failed because code coverage wasn't sent to coveralls.io. |
Merging. GHA is new/experimental and Travis is passing. |
@masterjus Care to share more complete code on how you extended |
Proof https://www.php.net/manual/en/language.oop5.late-static-bindings.php