Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractBackoffStrategy
  • AbstractErrorCodeBackoffStrategy
  • BackoffLogger
  • BackoffPlugin
  • CallbackBackoffStrategy
  • ConstantBackoffStrategy
  • CurlBackoffStrategy
  • ExponentialBackoffStrategy
  • HttpBackoffStrategy
  • LinearBackoffStrategy
  • ReasonPhraseBackoffStrategy
  • TruncatedBackoffStrategy

Interfaces

  • BackoffStrategyInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Plugin\Backoff;
 4: 
 5: /**
 6:  * Strategy used to retry when certain error codes are encountered
 7:  */
 8: abstract class AbstractErrorCodeBackoffStrategy extends AbstractBackoffStrategy
 9: {
10:     /**
11:      * @var array Default cURL errors to retry
12:      */
13:     protected static $defaultErrorCodes = array();
14: 
15:     /**
16:      * @var array Error codes that can be retried
17:      */
18:     protected $errorCodes;
19: 
20:     /**
21:      * @param array                    $codes Array of codes that should be retried
22:      * @param BackoffStrategyInterface $next  The optional next strategy
23:      */
24:     public function __construct(array $codes = null, BackoffStrategyInterface $next = null)
25:     {
26:         $this->errorCodes = array_fill_keys($codes ?: static::$defaultErrorCodes, 1);
27:         $this->next = $next;
28:     }
29: 
30:     /**
31:      * Get the default failure codes to retry
32:      *
33:      * @return array
34:      */
35:     public static function getDefaultFailureCodes()
36:     {
37:         return static::$defaultErrorCodes;
38:     }
39: 
40:     /**
41:      * {@inheritdoc}
42:      */
43:     public function makesDecision()
44:     {
45:         return true;
46:     }
47: }
48: 
php-coveralls API documentation generated by ApiGen 2.8.0