Skip to content

Conversation

bmxmale
Copy link

@bmxmale bmxmale commented Apr 19, 2021

No description provided.

@bmxmale bmxmale changed the title ISSUE-75 Retry request on network failure #75 Retry request on network failure Apr 19, 2021
$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);
Copy link
Contributor

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:

but that's a breaking change I guess.

Copy link
Owner

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

Copy link
Owner

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
Copy link
Contributor

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-commenter
Copy link

codecov-commenter commented Apr 19, 2021

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants