protected function redirectToAction(string $alias = null, array $params = []): RedirectResponse
    {
        if (empty($alias)) {
            $routerConfig = $this->getRouter()->getConfiguration();
            $alias = "{$routerConfig->getDefaultController()}:{$routerConfig->getDefaultAction()}";
        }

        $query = $this->getRouter()->getQuery($alias, $params);
        $headers = $this->getResponse()->headers->all();

        return new RedirectResponse($query, Response::HTTP_FOUND, $headers);
    }