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);
    }