GrumPHP\Configuration\GrumPHP::stopOnFailure PHP Метод

stopOnFailure() публичный Метод

public stopOnFailure ( ) : boolean
Результат boolean
    public function stopOnFailure()
    {
        return (bool) $this->container->getParameter('stop_on_failure');
    }

Usage Example

Пример #1
0
 /**
  * @param ContextInterface $context
  *
  * @throws FailureException if any of the tasks fail
  */
 public function run(ContextInterface $context)
 {
     $failures = false;
     $messages = array();
     $tasks = $this->tasks->filterByContext($context)->sortByPriority($this->grumPHP);
     $this->eventDispatcher->dispatch(RunnerEvents::RUNNER_RUN, new RunnerEvent($tasks));
     foreach ($tasks as $task) {
         try {
             $this->eventDispatcher->dispatch(TaskEvents::TASK_RUN, new TaskEvent($task));
             $task->run($context);
             $this->eventDispatcher->dispatch(TaskEvents::TASK_COMPLETE, new TaskEvent($task));
         } catch (RuntimeException $e) {
             $this->eventDispatcher->dispatch(TaskEvents::TASK_FAILED, new TaskFailedEvent($task, $e));
             $messages[] = $e->getMessage();
             $failures = true;
             if ($this->grumPHP->stopOnFailure()) {
                 break;
             }
         }
     }
     if ($failures) {
         $this->eventDispatcher->dispatch(RunnerEvents::RUNNER_FAILED, new RunnerFailedEvent($tasks, $messages));
         throw new FailureException(implode(PHP_EOL, $messages));
     }
     $this->eventDispatcher->dispatch(RunnerEvents::RUNNER_COMPLETE, new RunnerEvent($tasks));
 }
All Usage Examples Of GrumPHP\Configuration\GrumPHP::stopOnFailure