application/Libraries/Core.php
/**
     * Check if specified method is valid
     * 
     * - Check if method exists in controller
     * - Validate for both ajax and view request
     * - Check if method is public 
     * - Check if called method is a route method or not
     * 
     * @param object $controller Controller Object
     * @param string $method Name of method to check
     * @return bool If method is valid or not
     */
Check if specified method is valid

- Check if method exists in controller
- Validate for both ajax and view request
- Check if method is public
- Check if called method is a route method or not

@param object $controller Controller Object
@param string $method Name of method to check
@return bool If method is valid or not
Check if specified method is valid - Check if method exists in controller - Validate for both ajax and view request - Check if method is public - Check if called method is a route method or not @param object $controller Controller Object @param string $method Name of method to check @return bool If method is valid or not
private function checkMethod(object $controller, string $method): bool {
        if($this->requestType === "ajax") {
            return $this->validateAjaxMethod($controller, $method);   
        } else {
            if(method_exists($controller, $method)) {
                $reflectedMethod = new ReflectionMethod($controller, $method);
                if($reflectedMethod->isPublic() && $this->isRoute($controller, $method)) {
                    return true;
                }
            }
            return false;
        }
    }
private function checkMethod ( object $ controller , string $ method ) : bool { if ( $ this -> requestType === " ajax " ) { return $ this -> validateAjaxMethod ( $ controller , $ method ) ; } else { if ( method_exists ( $ controller , $ method ) ) { $ reflectedMethod = new ReflectionMethod ( $ controller , $ method ) ; if ( $ reflectedMethod -> isPublic ( ) && $ this -> isRoute ( $ controller , $ method ) ) { return true ; } } return false ; } }
Check if specified method is valid
Check if specified method is valid