src/Control/HTTPRequest.php
public static function detect_method($origMethod, $postVars)
    {
        if (isset($postVars['_method'])) {
            if (!in_array(strtoupper($postVars['_method']), array('GET','POST','PUT','DELETE','HEAD'))) {
                user_error('HTTPRequest::detect_method(): Invalid "_method" parameter', E_USER_ERROR);
            }
            return strtoupper($postVars['_method']);
        } else {
            return $origMethod;
        }
    }
public static function detect_method($origMethod, $postVars)
    {
        if (isset($postVars['_method'])) {
            if (!in_array(strtoupper($postVars['_method']), array('GET','POST','PUT','DELETE','HEAD'))) {
                user_error('HTTPRequest::detect_method(): Invalid "_method" parameter', E_USER_ERROR);
            }
            return strtoupper($postVars['_method']);
        } else {
            return $origMethod;
        }
    }
public static function detect_method ( $ origMethod , $ postVars ) { if ( isset ( $ postVars [ '_method' ] ) ) { if ( ! in_array ( strtoupper ( $ postVars [ '_method' ] ) , array ( 'GET' , 'POST' , 'PUT' , 'DELETE' , 'HEAD' ) ) ) { user_error ( 'HTTPRequest::detect_method(): Invalid "_method" parameter' , E_USER_ERROR ) ; } return strtoupper ( $ postVars [ '_method' ] ) ; } else { return $ origMethod ; } }
Gets the "real" HTTP method for a request.

Used to work around browser limitations of form
submissions to GET and POST, by overriding the HTTP method
with a POST parameter called "_method" for PUT, DELETE, HEAD.
Using GET for the "_method" override is not supported,
as GET should never carry out state changes.
Alternatively you can use a custom HTTP header 'X-HTTP-Method-Override'
to override the original method.
The '_method' POST parameter overrules the custom HTTP header.

@param string $origMethod Original HTTP method from the browser request
@param array $postVars
@return string HTTP method (all uppercase)
Gets the real HTTP method for a request .