public static function task($name, $data = null, \Closure $ready = null)
    {
        $task = self::getTask($name);
        if (!$task) {
            if (is_callable($data)) {
                $ready = $data;
                $data = null;
            }
            $task = Task::create($name, $data, $ready);
            self::$tasks[$name] = $task;
        }

        return $task;
    }