Altax\Command\Command::runAfterTask PHP Method

runAfterTask() protected method

protected runAfterTask ( $output )
    protected function runAfterTask($output)
    {
        $tasks = $this->definedTask->getAfterTasks();
        foreach ($tasks as $task) {
            if ($output->isVerbose()) {
                $output->writeln("<info>Found a after task need to run: </info>" . $task->getName());
            }
            if (in_array($task->getName(), $this->ancestry)) {
                $output->writeln("<error>Skip a before task " . $task->getName() . " to prevent infinit loop. Because of existing it in ancestry tasks.</error>");
                continue;
            }
            $command = $this->getApplication()->find($task->getName());
            if (!$command) {
                throw new \RuntimeException("Not found a after task command '{$taskName}'.");
            }
            $command->setAncestry($this->ancestry);
            $input = new ArrayInput(array("command" => $task->getName()));
            $command->run($input, $output);
        }
    }