protected static function nodeMatch(AbstractNavigationNode $node, Request $request) {

        $result = false;

        switch ($node->getMatcher()) {

            case NavigationInterface::NAVIGATION_MATCHER_REGEXP:
                $result = preg_match("/" . $node->getUri() . "/", $request->getUri());
                break;

            case NavigationInterface::NAVIGATION_MATCHER_ROUTER:
                $result = $request->get("_route") === $node->getUri();
                break;

            case NavigationInterface::NAVIGATION_MATCHER_URL:
                $result = $request->getUri() === $node->getUri() || $request->getRequestUri() === $node->getUri();
                break;
        }

        return boolval($result);
    }
protected static function nodeMatch(AbstractNavigationNode $node, Request $request) {

        $result = false;

        switch ($node->getMatcher()) {

            case NavigationInterface::NAVIGATION_MATCHER_REGEXP:
                $result = preg_match("/" . $node->getUri() . "/", $request->getUri());
                break;

            case NavigationInterface::NAVIGATION_MATCHER_ROUTER:
                $result = $request->get("_route") === $node->getUri();
                break;

            case NavigationInterface::NAVIGATION_MATCHER_URL:
                $result = $request->getUri() === $node->getUri() || $request->getRequestUri() === $node->getUri();
                break;
        }

        return boolval($result);
    }
protected static function nodeMatch ( AbstractNavigationNode $ node , Request $ request ) { $ result = false ; switch ( $ node -> getMatcher ( ) ) { case NavigationInterface :: NAVIGATION_MATCHER_REGEXP : $ result = preg_match ( "/" . $ node -> getUri ( ) . "/" , $ request -> getUri ( ) ) ; break ; case NavigationInterface :: NAVIGATION_MATCHER_ROUTER : $ result = $ request -> get ( "_route" ) === $ node -> getUri ( ) ; break ; case NavigationInterface :: NAVIGATION_MATCHER_URL : $ result = $ request -> getUri ( ) === $ node -> getUri ( ) || $ request -> getRequestUri ( ) === $ node -> getUri ( ) ; break ; } return boolval ( $ result ) ; }
Determines if a node match an URL.

@param AbstractNavigationNode $node The node.
@param Request $request The request.
@return bool Returns true in case of success, false otherwise.
Determines if a node match an URL .