protected function handleNoMatch()
    {
        $result = $this->hooks->exec("router.dispatcher.routeNotFound");
        // check if hook call produced a valid Route object
        if ($result instanceof Route) {
            $this->logger->info("No Route found, hook call produced valid Route object, using it instead.");
            return $result;
        } elseif (is_array($result)) {
            foreach ($result as $r) {
                if ($r instanceof Route) {
                    $this->logger->info("No Route found, hook call produced valid Route object, using it instead.");
                    return $r;
                }
            }
        }
        return $this->routes->get404Route();
    }
protected function handleNoMatch()
    {
        $result = $this->hooks->exec("router.dispatcher.routeNotFound");
        // check if hook call produced a valid Route object
        if ($result instanceof Route) {
            $this->logger->info("No Route found, hook call produced valid Route object, using it instead.");
            return $result;
        } elseif (is_array($result)) {
            foreach ($result as $r) {
                if ($r instanceof Route) {
                    $this->logger->info("No Route found, hook call produced valid Route object, using it instead.");
                    return $r;
                }
            }
        }
        return $this->routes->get404Route();
    }
protected function handleNoMatch ( ) { $ result = $ this -> hooks -> exec ( "router.dispatcher.routeNotFound" ) ; // check if hook call produced a valid Route object if ( $ result instanceof Route ) { $ this -> logger -> info ( "No Route found, hook call produced valid Route object, using it instead." ) ; return $ result ; } elseif ( is_array ( $ result ) ) { foreach ( $ result as $ r ) { if ( $ r instanceof Route ) { $ this -> logger -> info ( "No Route found, hook call produced valid Route object, using it instead." ) ; return $ r ; } } } return $ this -> routes -> get404Route ( ) ; }
Handle No Matching Route Found

Execute the Route Not Found Hook definition with the help of the Hook component
and return a valid Route object if it is found in the Hook execution return
data. If no valid route is returned by the hook, try to obtain the 404 route
from the Route Container object and return it.

@return \SlaxWeb\Router\Route|null
Handle No Matching Route Found