Phulp\Phulp::start PHP Method

start() public method

public start ( array $tasks )
$tasks array
    public function start(array $tasks)
    {
        foreach ($tasks as $task) {
            if (!isset($this->tasks[$task])) {
                throw new \RuntimeException('The task "' . $task . '" does not exists.');
            }
            Output::out('[' . Output::colorize((new \DateTime())->format('H:i:s'), 'light_gray') . ']' . ' Starting task "' . Output::colorize($task, 'light_cyan') . '"');
            $start = microtime(true);
            $callback = $this->tasks[$task];
            $callback($this);
            Output::out('[' . Output::colorize((new \DateTime())->format('H:i:s'), 'light_gray') . ']' . ' Task "' . Output::colorize($task, 'light_cyan') . '" has finished in ' . Output::colorize(round(microtime(true) - $start, 4) . ' seconds', 'magenta'));
        }
    }