public function getTasksListeners($task, $event, $flatten = false)
    {
        // Get events
        $task = $this->builder->buildTaskFromClass($task);
        $handle = $this->getEventHandle($task, $event);
        $events = $this->events->getListeners($handle);

        // Flatten the queue if requested
        foreach ($events as $key => $listener) {
            if ($flatten && $listener instanceof ClosureTask && $stringTask = $listener->getStringTask()) {
                $events[$key] = $stringTask;
            } elseif ($flatten && $listener instanceof AbstractTask) {
                $events[$key] = $listener->getSlug();
            }
        }

        return $events;
    }