private function setMethod(string $method = null): void
    {
        if ('GET' == $method) {
            $this->method = 'GET';

            return;
        }
        if ('POST' == $method) {
            $this->method = 'POST';

            return;
        }
        if ('PUT' == $method) {
            $this->method = 'PUT';

            return;
        }
        if ('DELETE' == $method) {
            $this->method = 'DELETE';

            return;
        }
        if ('HEAD' == $method) {
            $this->method = 'HEAD';

            return;
        }

        throw new \InvalidArgumentException('DigestAuthMiddleware: Only GET,POST,PUT,DELETE,HEAD HTTP methods are currently supported.');
    }
private function setMethod(string $method = null): void
    {
        if ('GET' == $method) {
            $this->method = 'GET';

            return;
        }
        if ('POST' == $method) {
            $this->method = 'POST';

            return;
        }
        if ('PUT' == $method) {
            $this->method = 'PUT';

            return;
        }
        if ('DELETE' == $method) {
            $this->method = 'DELETE';

            return;
        }
        if ('HEAD' == $method) {
            $this->method = 'HEAD';

            return;
        }

        throw new \InvalidArgumentException('DigestAuthMiddleware: Only GET,POST,PUT,DELETE,HEAD HTTP methods are currently supported.');
    }
private function setMethod ( string $ method = null ) : void { if ( 'GET' == $ method ) { $ this -> method = 'GET' ; return ; } if ( 'POST' == $ method ) { $ this -> method = 'POST' ; return ; } if ( 'PUT' == $ method ) { $ this -> method = 'PUT' ; return ; } if ( 'DELETE' == $ method ) { $ this -> method = 'DELETE' ; return ; } if ( 'HEAD' == $ method ) { $ this -> method = 'HEAD' ; return ; } throw new \ InvalidArgumentException ( 'DigestAuthMiddleware: Only GET,POST,PUT,DELETE,HEAD HTTP methods are currently supported.' ) ; }
Sets the HTTP method being used for the request.

@param string $method The HTTP method

@throws \InvalidArgumentException if $method is set to anything other than GET,POST,PUT,DELETE or HEAD
Sets the HTTP method being used for the request .