public function setHttpMethod($method)
    {
        $method = strtoupper( (string) $method);

        if ( ! in_array($method, $this->allowedHttpMethods)) {

            throw new InvalidArgumentException("Invalid HTTP method: '{$method}'");
        }

        $this->setAttribute('http_method', $method);

        return $this;
    }