public function fetchRequestMethod($server = null)
    {
        $server || $server = $this->_SERVER;

        if (isset($_POST['_method'])) {
            if (
                strtoupper($_POST['_method']) == 'PUT' ||
                strtoupper($_POST['_method']) == 'PATCH' ||
                strtoupper($_POST['_method']) == 'DELETE'
            ) {
                return strtoupper($_POST['_method']);
            }
        }

        if (php_sapi_name() == 'cli' || defined('STDIN')) {
            return 'CLI';
        }

        return $server['REQUEST_METHOD'];
    }
public function fetchRequestMethod($server = null)
    {
        $server || $server = $this->_SERVER;

        if (isset($_POST['_method'])) {
            if (
                strtoupper($_POST['_method']) == 'PUT' ||
                strtoupper($_POST['_method']) == 'PATCH' ||
                strtoupper($_POST['_method']) == 'DELETE'
            ) {
                return strtoupper($_POST['_method']);
            }
        }

        if (php_sapi_name() == 'cli' || defined('STDIN')) {
            return 'CLI';
        }

        return $server['REQUEST_METHOD'];
    }
public function fetchRequestMethod ( $ server = null ) { $ server || $ server = $ this -> _SERVER ; if ( isset ( $ _POST [ '_method' ] ) ) { if ( strtoupper ( $ _POST [ '_method' ] ) == 'PUT' || strtoupper ( $ _POST [ '_method' ] ) == 'PATCH' || strtoupper ( $ _POST [ '_method' ] ) == 'DELETE' ) { return strtoupper ( $ _POST [ '_method' ] ) ; } } if ( php_sapi_name ( ) == 'cli' || defined ( 'STDIN' ) ) { return 'CLI' ; } return $ server [ 'REQUEST_METHOD' ] ; }
Fetch the http method
Fetch the http method