src/Core/Router.php
protected function getAllowedMethodsForRoute(ControllerInterface $class, $action)
    {
        $actionsInfo = $class->getMethods();
        if (isset($actionsInfo[$action])) {
            $methods = implode(', ', $actionsInfo[$action]->getAllowedMethods());

            $methodInfo = ReflectionHelper::getMethodInfo($class, $action);

            header('Access-Control-Allow-Origin : *');
            header('Access-Control-Allow-Methods : ' . $methods);
            header('Access-Control-Allow-Headers : *');

            return $methodInfo;
        }

        return [];
    }
protected function getAllowedMethodsForRoute(ControllerInterface $class, $action)
    {
        $actionsInfo = $class->getMethods();
        if (isset($actionsInfo[$action])) {
            $methods = implode(', ', $actionsInfo[$action]->getAllowedMethods());

            $methodInfo = ReflectionHelper::getMethodInfo($class, $action);

            header('Access-Control-Allow-Origin : *');
            header('Access-Control-Allow-Methods : ' . $methods);
            header('Access-Control-Allow-Headers : *');

            return $methodInfo;
        }

        return [];
    }
protected function getAllowedMethodsForRoute ( ControllerInterface $ class , $ action ) { $ actionsInfo = $ class -> getMethods ( ) ; if ( isset ( $ actionsInfo [ $ action ] ) ) { $ methods = implode ( ', ' , $ actionsInfo [ $ action ] -> getAllowedMethods ( ) ) ; $ methodInfo = ReflectionHelper :: getMethodInfo ( $ class , $ action ) ; header ( 'Access-Control-Allow-Origin : *' ) ; header ( 'Access-Control-Allow-Methods : ' . $ methods ) ; header ( 'Access-Control-Allow-Headers : *' ) ; return $ methodInfo ; } return [ ] ; }
Return action description and set headers to output

@param ControllerInterface $class
@param string $action
@return array
Return action description and set headers to output