Laravel\Envoy\Console\RunCommand::runTask PHP Method

runTask() protected method

Run the given task out of the container.
protected runTask ( TaskContainer $container, string $task ) : null | integer | void
$container Laravel\Envoy\TaskContainer
$task string
return null | integer | void
    protected function runTask($container, $task)
    {
        $macroOptions = $container->getMacroOptions($this->argument('task'));
        $confirm = $container->getTask($task, $macroOptions)->confirm;
        if ($confirm && !$this->confirmTaskWithUser($task, $confirm)) {
            return;
        }
        if (($exitCode = $this->runTaskOverSSH($container->getTask($task, $macroOptions))) > 0) {
            foreach ($container->getErrorCallbacks() as $callback) {
                call_user_func($callback, $task);
            }
            return $exitCode;
        }
        foreach ($container->getAfterCallbacks() as $callback) {
            call_user_func($callback, $task);
        }
    }