src/Guzzle/Batch/BatchBuilder.php
public function build()
    {
        if (!$this->transferStrategy) {
            throw new RuntimeException('No transfer strategy has been specified');
        }

        if (!$this->divisorStrategy) {
            throw new RuntimeException('No divisor strategy has been specified');
        }

        $batch = new Batch($this->transferStrategy, $this->divisorStrategy);

        if ($this->exceptionBuffering) {
            $batch = new ExceptionBufferingBatch($batch);
        }

        if ($this->afterFlush) {
            $batch = new NotifyingBatch($batch, $this->afterFlush);
        }

        if ($this->autoFlush) {
            $batch = new FlushingBatch($batch, $this->autoFlush);
        }

        if ($this->history) {
            $batch = new HistoryBatch($batch);
        }

        return $batch;
    }
public function build()
    {
        if (!$this->transferStrategy) {
            throw new RuntimeException('No transfer strategy has been specified');
        }

        if (!$this->divisorStrategy) {
            throw new RuntimeException('No divisor strategy has been specified');
        }

        $batch = new Batch($this->transferStrategy, $this->divisorStrategy);

        if ($this->exceptionBuffering) {
            $batch = new ExceptionBufferingBatch($batch);
        }

        if ($this->afterFlush) {
            $batch = new NotifyingBatch($batch, $this->afterFlush);
        }

        if ($this->autoFlush) {
            $batch = new FlushingBatch($batch, $this->autoFlush);
        }

        if ($this->history) {
            $batch = new HistoryBatch($batch);
        }

        return $batch;
    }
public function build ( ) { if ( ! $ this -> transferStrategy ) { throw new RuntimeException ( 'No transfer strategy has been specified' ) ; } if ( ! $ this -> divisorStrategy ) { throw new RuntimeException ( 'No divisor strategy has been specified' ) ; } $ batch = new Batch ( $ this -> transferStrategy , $ this -> divisorStrategy ) ; if ( $ this -> exceptionBuffering ) { $ batch = new ExceptionBufferingBatch ( $ batch ) ; } if ( $ this -> afterFlush ) { $ batch = new NotifyingBatch ( $ batch , $ this -> afterFlush ) ; } if ( $ this -> autoFlush ) { $ batch = new FlushingBatch ( $ batch , $ this -> autoFlush ) ; } if ( $ this -> history ) { $ batch = new HistoryBatch ( $ batch ) ; } return $ batch ; }
Create and return the instantiated batch

@return BatchInterface
@throws RuntimeException if no transfer strategy has been specified
Create and return the instantiated batch