Open Journal Systems  3.3.0
BatchClosureDivisor.php
1 <?php
2 
3 namespace Guzzle\Batch;
4 
6 
11 {
13  protected $callable;
14 
16  protected $context;
17 
25  public function __construct($callable, $context = null)
26  {
27  if (!is_callable($callable)) {
28  throw new InvalidArgumentException('Must pass a callable');
29  }
30 
31  $this->callable = $callable;
32  $this->context = $context;
33  }
34 
35  public function createBatches(\SplQueue $queue)
36  {
37  return call_user_func($this->callable, $queue, $this->context);
38  }
39 }
Guzzle\Batch\BatchClosureDivisor\$context
$context
Definition: BatchClosureDivisor.php:22
Guzzle\Batch
Definition: AbstractBatchDecorator.php:3
Guzzle\Batch\BatchClosureDivisor\$callable
$callable
Definition: BatchClosureDivisor.php:16
Guzzle\Batch\BatchClosureDivisor
Definition: BatchClosureDivisor.php:10
Guzzle\Batch\BatchClosureDivisor\__construct
__construct($callable, $context=null)
Definition: BatchClosureDivisor.php:31
Guzzle\Common\Exception\InvalidArgumentException
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Common/Exception/InvalidArgumentException.php:5
Guzzle\Batch\BatchClosureDivisor\createBatches
createBatches(\SplQueue $queue)
Definition: BatchClosureDivisor.php:41
Guzzle\Batch\BatchDivisorInterface
Definition: BatchDivisorInterface.php:8