Вход Регистрация
Файл: vkolhoze.com/vendor/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php
Строк: 30
<?php

namespace GuzzlePluginBackoff;

use 
GuzzleHttpMessageRequestInterface;
use 
GuzzleHttpMessageResponse;
use 
GuzzleHttpExceptionHttpException;

/**
 * Strategy used to retry HTTP requests when the response's reason phrase matches one of the registered phrases.
 */
class ReasonPhraseBackoffStrategy extends AbstractErrorCodeBackoffStrategy
{
    public function 
makesDecision()
    {
        return 
true;
    }

    protected function 
getDelay($retriesRequestInterface $requestResponse $response nullHttpException $e null)
    {
        if (
$response) {
            return isset(
$this->errorCodes[$response->getReasonPhrase()]) ? true null;
        }
    }
}
Онлайн: 0
Реклама