Remove conditional from `onRejected`
caseyamcl opened this issue · comments
Refactor this block to assume that the Create
class exists:
// ...
// If made it here, then we have decided not to retry the request
// Future-proofing this; remove when bumping minimum Guzzle version to 7.0
if (class_exists('\GuzzleHttp\Promise\Create')) {
return \GuzzleHttp\Promise\Create::rejectionFor($reason);
} else {
return rejection_for($reason);
}
This will require updating the Guzzle dependency to v7, so this can't happen for a while.