Open Journal Systems  3.3.0
NotifyingBatch.php
1 <?php
2 
3 namespace Guzzle\Batch;
4 
6 
11 {
13  protected $callable;
14 
22  {
23  if (!is_callable($callable)) {
24  throw new InvalidArgumentException('The passed argument is not callable');
25  }
26 
27  $this->callable = $callable;
28  parent::__construct($decoratedBatch);
29  }
30 
31  public function flush()
32  {
33  $items = $this->decoratedBatch->flush();
34  call_user_func($this->callable, $items);
35 
36  return $items;
37  }
38 }
Guzzle\Batch
Definition: AbstractBatchDecorator.php:3
Guzzle\Batch\BatchInterface
Definition: BatchInterface.php:8
Guzzle\Common\Exception\InvalidArgumentException
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Common/Exception/InvalidArgumentException.php:5
Guzzle\Batch\NotifyingBatch\$callable
$callable
Definition: NotifyingBatch.php:16
Guzzle\Batch\NotifyingBatch\flush
flush()
Definition: NotifyingBatch.php:34
Guzzle\Batch\AbstractBatchDecorator\$decoratedBatch
$decoratedBatch
Definition: AbstractBatchDecorator.php:14
Guzzle\Batch\AbstractBatchDecorator
Definition: AbstractBatchDecorator.php:8
Guzzle\Batch\NotifyingBatch\__construct
__construct(BatchInterface $decoratedBatch, $callable)
Definition: NotifyingBatch.php:24
Guzzle\Batch\NotifyingBatch
Definition: NotifyingBatch.php:10