original_string: public function restart()
      {
          $workers = $this->ResqueStatus->getWorkers();
  
          $this->outputTitle('Restarting workers');
  
          if (!empty($workers)) {
              $this->stop();
  
              foreach ($workers as $worker) {
                  if (isset($worker['type']) && $worker['type'] === 'scheduler') {
                      $this->startScheduler($worker);
                  } else {
                      $this->start($worker);
                  }
              }
          } else {
              $this->output->outputLine('No workers to restart', 'failure');
          }
  
          $this->output->outputLine();
      }
code: public function restart()
      {
          $workers = $this->ResqueStatus->getWorkers();
  
          $this->outputTitle('Restarting workers');
  
          if (!empty($workers)) {
              $this->stop();
  
              foreach ($workers as $worker) {
                  if (isset($worker['type']) && $worker['type'] === 'scheduler') {
                      $this->startScheduler($worker);
                  } else {
                      $this->start($worker);
                  }
              }
          } else {
              $this->output->outputLine('No workers to restart', 'failure');
          }
  
          $this->output->outputLine();
      }
code_tokens: public function restart ( ) { $ workers = $ this -> ResqueStatus -> getWorkers ( ) ; $ this -> outputTitle ( 'Restarting workers' ) ; if ( ! empty ( $ workers ) ) { $ this -> stop ( ) ; foreach ( $ workers as $ worker ) { if ( isset ( $ worker [ 'type' ] ) && $ worker [ 'type' ] === 'scheduler' ) { $ this -> startScheduler ( $ worker ) ; } else { $ this -> start ( $ worker ) ; } } } else { $ this -> output -> outputLine ( 'No workers to restart' , 'failure' ) ; } $ this -> output -> outputLine ( ) ; }
docstring: Restart all workers
  
  @return  void
docstring_tokens: Restart all workers