public function resolveNotFoundRoute()
    {
        // Try to resolve 404 route. If such route don't
        // exist just redirect to the homepage.
        try {
            if ($notFoundRoute = $this->routes->get('404')) {
                return $notFoundRoute->run();
            }
        } catch (RoutingException $e) {
            if (wp_redirect(home_url())) {
                // WordPress requires to call exit after wp_redirect.
                // We cannot test it, so ignore this single line.
                // @codeCoverageIgnoreStart
                exit();
                // @codeCoverageIgnoreEnd
            }
        }
    }