public function method($method)
    {
        if (!in_array($method, $this->methods)) {
            throw new \InvalidArgumentException("Unknown HTTP method: $method");
        }

        $this->method = $method;

        return $this;
    }