original_string: public function output($args)
      {
          $args += ['callback' => null];
          if (isset($args[0])) {
              $args['callback'] = $args[0];
          }
          if (!$args['callback'] || !is_callable($args['callback'])) {
              throw new RuntimeException('Callback option must be a callable.');
          }
          $this->init($args);
  
          $callback = $args['callback'];
  
          $this->_io->out('', 0);
          while ($this->_progress < $this->_total) {
              $callback($this);
              $this->draw();
          }
          $this->_io->out('');
      }
code: public function output($args)
      {
          $args += ['callback' => null];
          if (isset($args[0])) {
              $args['callback'] = $args[0];
          }
          if (!$args['callback'] || !is_callable($args['callback'])) {
              throw new RuntimeException('Callback option must be a callable.');
          }
          $this->init($args);
  
          $callback = $args['callback'];
  
          $this->_io->out('', 0);
          while ($this->_progress < $this->_total) {
              $callback($this);
              $this->draw();
          }
          $this->_io->out('');
      }
code_tokens: public function output ( $ args ) { $ args += [ 'callback' => null ] ; if ( isset ( $ args [ 0 ] ) ) { $ args [ 'callback' ] = $ args [ 0 ] ; } if ( ! $ args [ 'callback' ] || ! is_callable ( $ args [ 'callback' ] ) ) { throw new RuntimeException ( 'Callback option must be a callable.' ) ; } $ this -> init ( $ args ) ; $ callback = $ args [ 'callback' ] ; $ this -> _io -> out ( '' , 0 ) ; while ( $ this -> _progress < $ this -> _total ) { $ callback ( $ this ) ; $ this -> draw ( ) ; } $ this -> _io -> out ( '' ) ; }
docstring: Output a progress bar.
  
  Takes a number of options to customize the behavior:
  
  - `total` The total number of items in the progress bar. Defaults
  to 100.
  - `width` The width of the progress bar. Defaults to 80.
  - `callback` The callback that will be called in a loop to advance the progress bar.
  
  @param array $args The arguments/options to use when outputing the progress bar.
  @return void
docstring_tokens: Output a progress bar .