public function getOptions(Request $request)
    {
        $return = array();
        if ($request->attributes->has('is_rest_request') && $request->attributes->get('is_rest_request') === true) {
            $return['allow_methods'] = $this->getAllowedMethods($request->getPathInfo());
        }

        return $return;
    }
public function getOptions(Request $request)
    {
        $return = array();
        if ($request->attributes->has('is_rest_request') && $request->attributes->get('is_rest_request') === true) {
            $return['allow_methods'] = $this->getAllowedMethods($request->getPathInfo());
        }

        return $return;
    }
public function getOptions ( Request $ request ) { $ return = array ( ) ; if ( $ request -> attributes -> has ( 'is_rest_request' ) && $ request -> attributes -> get ( 'is_rest_request' ) === true ) { $ return [ 'allow_methods' ] = $ this -> getAllowedMethods ( $ request -> getPathInfo ( ) ) ; } return $ return ; }
Returns allowed CORS methods for a REST route.

@param \Symfony\Component\HttpFoundation\Request $request

@return array
Returns allowed CORS methods for a REST route .