protected function delegate($task, ...$args)
    {
        if (method_exists($this, $task)) {
            return $this->container->call([$this, $task], $args, $this);
        }

        if (is_callable($task)) {
            return $this->container->call($task, $args, $this);
        }

        throw new \LogicException('Task: ' . $task . ' not found.');
    }