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

  • AbstractBatchDecorator
  • Batch
  • BatchBuilder
  • BatchClosureDivisor
  • BatchClosureTransfer
  • BatchCommandTransfer
  • BatchRequestTransfer
  • BatchSizeDivisor
  • ExceptionBufferingBatch
  • FlushingBatch
  • HistoryBatch
  • NotifyingBatch

Interfaces

  • BatchDivisorInterface
  • BatchInterface
  • BatchTransferInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Batch;
 4: 
 5: /**
 6:  * Abstract decorator used when decorating a BatchInterface
 7:  */
 8: abstract class AbstractBatchDecorator implements BatchInterface
 9: {
10:     /**
11:      * @var BatchInterface Decorated batch object
12:      */
13:     protected $decoratedBatch;
14: 
15:     /**
16:      * Create the decorator
17:      *
18:      * @param BatchInterface $decoratedBatch  BatchInterface that is being decorated
19:      */
20:     public function __construct(BatchInterface $decoratedBatch)
21:     {
22:         $this->decoratedBatch = $decoratedBatch;
23:     }
24: 
25:     /**
26:      * Allow decorators to implement custom methods
27:      *
28:      * @param string $method Missing method name
29:      * @param array  $args   Method arguments
30:      *
31:      * @return mixed
32:      * @codeCoverageIgnore
33:      */
34:     public function __call($method, array $args = null)
35:     {
36:         return call_user_func_array(array($this->decoratedBatch, $method), $args);
37:     }
38: 
39:     /**
40:      * {@inheritdoc}
41:      */
42:     public function add($item)
43:     {
44:         $this->decoratedBatch->add($item);
45: 
46:         return $this;
47:     }
48: 
49:     /**
50:      * {@inheritdoc}
51:      */
52:     public function flush()
53:     {
54:         return $this->decoratedBatch->flush();
55:     }
56: 
57:     /**
58:      * {@inheritdoc}
59:      */
60:     public function isEmpty()
61:     {
62:         return $this->decoratedBatch->isEmpty();
63:     }
64: 
65:     /**
66:      * Trace the decorators associated with the batch
67:      *
68:      * @return array
69:      */
70:     public function getDecorators()
71:     {
72:         $found = array($this);
73:         if (method_exists($this->decoratedBatch, 'getDecorators')) {
74:             $found = array_merge($found, $this->decoratedBatch->getDecorators());
75:         }
76: 
77:         return $found;
78:     }
79: }
80: 
php-coveralls API documentation generated by ApiGen 2.8.0