-
Notifications
You must be signed in to change notification settings - Fork 36
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
#75 Retry request on network failure #103
base: master
Are you sure you want to change the base?
Conversation
$response = parent::__doRequest($request, $location, $action, $version, $one_way); | ||
$response = parent::__doRequest($request, $location, $action, $version, $oneWay); | ||
if (null === $response) { | ||
return $this->__doRequest($request, $location, $action, $version, $oneWay); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may cause an infinite loop. It's better to throw an exception instead and let the application decide what to do next. @johnzuk I'd suggest to add 'exceptions' => true
to default options here:
GusApi/src/GusApi/Client/Builder.php
Line 53 in a9f777f
$options = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure it can be like what - exception sound like best option here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmxmale Also additional logic needs test coverage
@@ -4,9 +4,12 @@ | |||
|
|||
class SoapClient extends \SoapClient | |||
{ | |||
public function __doRequest($request, $location, $action, $version, $one_way = 0): string | |||
public function __doRequest($request, $location, $action, $version, $oneWay = false): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was historically named $one_way
and the type should be int
. It was changed in PHP 8 but we should support PHP 7.1+ https://www.php.net/manual/en/soapclient.dorequest.php#refsect1-soapclient.dorequest-changelog
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
============================================
- Coverage 92.54% 92.35% -0.19%
- Complexity 188 189 +1
============================================
Files 31 31
Lines 456 458 +2
============================================
+ Hits 422 423 +1
- Misses 34 35 +1
Continue to review full report at Codecov.
|
No description provided.