asserts a http method

@param  string $method
@return $this
7586
private function assertHttpMethod($method) {
        if (!$this->assertString($method)) return false;
        $validHttpMethods = array(
            'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT', 'PATCH', 'LINK', 'UNLINK'
        );
        if (!in_array($method, $validHttpMethods)) return false;
        return true;
    }
669389
private function create_basic_request($method) {
        $this->header_add(sprintf('%s %s %s', $method, $this->_path, $this->_protocol));
        $this->header_add(sprintf('Host: %s:%s', $this->_server, $this->_port));
        //$request .= sprintf('Connection: Keep-Alive');
        $this->header_add(sprintf('User-Agent: %s', $this->_user_agent));
        $this->header_add('Connection: TE');
        $this->header_add('TE: Trailers');
        if ($this->_auth == 'basic') {
            $this->header_add(sprintf('Authorization: Basic %s', base64_encode("$this->_user:$this->_pass")));
        } else if ($this->_auth == 'digest') {
            if ($signature = $this->digest_signature($method)){
                $this->header_add($signature);
            }
        } else if ($this->_auth == 'bearer') {
            $this->header_add(sprintf('Authorization: Bearer %s', $this->oauthtoken));
        }
    }
779061
public function enableRemote($method = null)
    {
        $this->is_remote = true;
        $this->disableCallback();// disable callback, we cannot have both

        if (!is_null($method) && method_exists($this, 'addAttribute')) {
            $this->addAttribute('data-method', $method);
        }

        return $this;
    }
1081441
public function setMethod(string $method) : Request
    {
        $this->method = $this->fixMethodCase($method);

        return $this;
    }
483563
public function method(string $method, string ...$methods): self
    {
        array_unshift($methods, $method);

        return $this->setAllowedMethods($methods);
    }
945961
public function setMethod($method)
	{
		if ($method === null || !is_array($method) || empty($method)) {
			throw new InvalidArgumentException('No method provided');
		}

		foreach ($method as $m) {
			if (!in_array($m, array('GET','POST','PUT','PATCH','DELETE'))) {
				throw new InvalidArgumentException('Method not allowed. allowed methods: GET, POST, PUT, PATCH, DELETE');
			}
		}

		$this->method = $method;

		return $this;
	}
752249
public function withMethod(string $method): self {
        if ($this->method === $method) {
            return $this;
        }

        $clone = clone $this;
        $clone->method = $method;

        return $clone;
    }
598654
public function setMethod($method)
    {
        $method     = strtoupper($method);
        $reflection = new \ReflectionClass('\JonnyW\PhantomJs\Http\RequestInterface');

        if (!$reflection->hasConstant('METHOD_' . $method)) {
            throw new InvalidMethodException(sprintf('Invalid method provided: %s', $method));
        }

        $this->method = $method;

        return $this;
    }
1352942
public function setTransport($method=null){
        switch($method){
            case "stream":
                $this->defaultOptions= array_merge_recursive($this->defaultOptions,[
                    'stream'        => true,
                    'stream_context' => [
                        'ssl' => [
                            'verify_peer' => false,
                            'verify_peer_name' => false,
                            'allow_self_signed' => true
                        ]
                    ]
                ]);
                break;
            case "curl":
            default:
                $method = 'curl';
                break;
        }
        $this->transportMethod = $method;
        return $this->initClient(); 
    }
448187
public final function withMethod($method): RequestInterface
   {
       if (!is_string($method)
        || !($toUpperMethod = strtoupper((string) $method))
        || $toUpperMethod !== $this->parseMethod($method)) {
           throw new InvalidArgumentException(
               "Can't get instance for method: " . $method . " not supported");
       }
       return $this->with("method", $toUpperMethod);
   }
650483
protected function filterMethod($method)
    {
        if ($method === null) {
            return $method;
        }

        if (!is_string($method)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Unsupported HTTP method; must be a string, received %s',
                    is_object($method) ? get_class($method) : gettype($method)
                )
            );
        }

        $method = strtoupper($method);

        if (!in_array($method, self::$validMethods)) {
            throw new \InvalidArgumentException(sprintf('Invalid HTTP method "%s" provided', $method));
        }

        return $method;
    }
10081
public function setDigestMethod($method)
	{
		if (array_key_exists($method, $this->openSSLAlgoMapping) &&
			array_key_exists($method, $this->digestMethodUriMapping))
		{
			$this->digestMethod = $method;
		}
		else
		{
			trigger_error(sprintf('The chosen digest method (%s) is not supported', $method), E_USER_WARNING);
		}
		
		$this->checkDigestSupport();
		
		return $this;
	}
535828
public static function setMethod($method = 'auto')
    {
        if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
            $method = 'auto';
        }

        self::$method = $method;

        return new self();
    }
993704
protected function configureHTTPMethod($method)
    {
        switch ($method) {
            case self::HTTP_GET:
                break;
            case self::HTTP_POST:
                return $this->addCurlOption(CURLOPT_POST, TRUE);
            default:
                return $this->addCurlOption(CURLOPT_CUSTOMREQUEST, $method);
        }
        return TRUE;
    }
176406
protected function createCallback(string $method): \Closure
    {
        return \Closure::bind(static function (...$args) use ($method) {
            return self::$method(...$args);
        }, null, $this->type);
    }
264016
protected function configureHTTPMethod($method) {
        switch($method){
            case self::HTTP_GET:
                $this->removeHeader('Content-Type');
                break;
            case self::HTTP_POST:
            case self::HTTP_PUT:
                $this->addHeader("Content-Type", "multipart/form-data");
        }
        return parent::configureHTTPMethod($method);
    }
365133
public function setMethod(string $method) : self
    {
        if ($method == 'GET') {
            $this->setCsrf(false);
        }

        return $this->addAttribute('method', $method);
    }