src/Graviton/RestBundle/Service/RestUtils.php
public function getOptionRoutes()
    {
        $cached = $this->cacheProvider->fetch('cached_restutils_route_options');
        if ($cached) {
            return $cached;
        }
        $ret = array_filter(
            $this->router->getRouteCollection()->all(),
            function ($route) {
                if (!in_array('OPTIONS', $route->getMethods())) {
                    return false;
                }
                // ignore all schema routes
                if (strpos($route->getPath(), '/schema') === 0) {
                    return false;
                }
                if ($route->getPath() == '/' || $route->getPath() == '/core/version') {
                    return false;
                }

                return is_null($route->getRequirement('id'));
            }
        );
        $this->cacheProvider->save('cached_restutils_route_options', $ret);
        return $ret;
    }
public function getOptionRoutes()
    {
        $cached = $this->cacheProvider->fetch('cached_restutils_route_options');
        if ($cached) {
            return $cached;
        }
        $ret = array_filter(
            $this->router->getRouteCollection()->all(),
            function ($route) {
                if (!in_array('OPTIONS', $route->getMethods())) {
                    return false;
                }
                // ignore all schema routes
                if (strpos($route->getPath(), '/schema') === 0) {
                    return false;
                }
                if ($route->getPath() == '/' || $route->getPath() == '/core/version') {
                    return false;
                }

                return is_null($route->getRequirement('id'));
            }
        );
        $this->cacheProvider->save('cached_restutils_route_options', $ret);
        return $ret;
    }
public function getOptionRoutes ( ) { $ cached = $ this -> cacheProvider -> fetch ( 'cached_restutils_route_options' ) ; if ( $ cached ) { return $ cached ; } $ ret = array_filter ( $ this -> router -> getRouteCollection ( ) -> all ( ) , function ( $ route ) { if ( ! in_array ( 'OPTIONS' , $ route -> getMethods ( ) ) ) { return false ; } // ignore all schema routes if ( strpos ( $ route -> getPath ( ) , '/schema' ) === 0 ) { return false ; } if ( $ route -> getPath ( ) == '/' || $ route -> getPath ( ) == '/core/version' ) { return false ; } return is_null ( $ route -> getRequirement ( 'id' ) ) ; } ) ; $ this -> cacheProvider -> save ( 'cached_restutils_route_options' , $ ret ) ; return $ ret ; }
It has been deemed that we search for OPTION routes in order to detect our
service routes and then derive the rest from them.

@return array An array with option routes
It has been deemed that we search for OPTION routes in order to detect our service routes and then derive the rest from them .