Set the protocol and protocol version of the response

@param string $protocol Response protocol
@param string $version  Protocol version

@return self
963230
public function setProtocol($protocol, $version)
    {
        $this->protocol = $protocol;
        $this->protocolVersion = $version;

        return $this;
    }
341543
public function selectVersion($version)
	{
		if ( ! in_array($version, $this->versions))
		{
			// not a value version
			return false;
		}

		$this->version = $version;

		return $this;
	}
380195
public function put(string $body, string $version = HttpVersion::HTTP_1_1): HttpResponse
    {
        return HttpRequest::create($this->httpUri, $this->headers)
                ->put($body, $this->timeout, $version);
    }
1015775
public function withProtocolVersions(array $versions): self {
        $versions = \array_unique($versions);

        if (empty($versions)) {
            throw new \Error("Empty array of protocol versions provided, must not be empty.");
        }

        foreach ($versions as $version) {
            if (!\in_array($version, ["1.0", "1.1", "2.0"], true)) {
                throw new \Error(
                    "Invalid HTTP protocol version: " . $version
                );
            }
        }

        if ($this->protocolVersions === $versions) {
            return $this;
        }

        $clone = clone $this;
        $clone->protocolVersions = $versions;

        return $clone;
    }
551048
public function setVersion(string $version)
    {
        if (!preg_match('/^\d+\.\d+\.\d+$/', $version)) {
            throw new \InvalidArgumentException(
                'Version number is invalid; ' . $version . ' does not match '
                . 'x.x.x (where x is a number)'
            );
        }

        $this->version = $version;
    }
293044
public function setVersion($version)
    {
        if(!is_float($version)){
            $version = (float) 1.1;
        }

        $this->options['version']=$version;
        return $this;
    }
713279
protected function createProtocol(string $protocol): self
    {
        $this->protocol = Factory::newProtocol($protocol);
        $this->protocol->setServer($this);

        return $this;
    }
27314
public function setRemoteVersionUrl(string $remoteVerUrl): void
    {
        if (empty($remoteVerUrl)) {
            throw new Exception('the parameter $remoteVerUrl can not be empty', Exception::VERSION_URL_MISSING);
        }

        $this->remoteVersionUrl = $remoteVerUrl;
    }
999364
public function sendStatus($protocol = null)
    {
        if (null === $protocol) {
            $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
        }
        header($protocol.' '.$this->_status.' '.$this->getStatusMessage($this->_status));

        return $this;
    }
76194
public function httpVersion($version) {

		if(false === defined($version)) {
			return trigger_error(sprintf('Argument 1 passed to %s() is not a valid HTTP protocol version', __METHOD__), E_USER_ERROR);
		}

		$this -> options[CURLOPT_HTTP_VERSION] = constant($version);

		return $this;
	}
344870
protected function setVersionHeader(string $output, Response $response)
    {
        $crawler = $this->getCrawler($this->createResponseWithLowerCaseContent($output));
        $node    = $crawler->filter('head > meta[http-equiv="x-pjax-version"]');

        if ($node->count()) {
            $response->getHeaders()->set('x-pjax-version', $node->attr('content'));
        }

        return $this;
    }
969052
public function setValue($version = 0.0)
    {
        $this->version = $version;
        $major = floor($version);
        $minor = ($version - $major) * 100;
        $strValue = sprintf('%02.0f%02.0f', $major, $minor);
        $this->components = strlen($strValue);
        $this->bytes = $strValue;
    }
940741
public function setHTTPVersion(int $version)
    {
        $this->http_version = ($version === 1 ? '1.0' : '' . $version);

        if ($this->http_version !== '1.0' && $this->http_version !== '1.1') {
            throw new RuntimeException('HTTP version  must be 1.0 or 1.1');
        }
    }
649373
public function setStatusHeader($status, $protocol = null)
    {
        if (is_null($protocol) && isset($_SERVER['SERVER_PROTOCOL'])) {
            $protocol = $_SERVER['SERVER_PROTOCOL'];
        } elseif (is_null($protocol) && !isset($_SERVER['SERVER_PROTOCOL'])) {
            $protocol = 'HTTP/1.1';
        }

        $this->status_header = trim($protocol . ' ' . $status);
    }
859485
public function setApplication(string $name, string $version = '')
    {
        $this->application = $name.($version ? '/'.$version : '');

        // Reset the cached value
        $this->cachedUserAgent = null;

        return $this;
    }
1227237
public static function setApplicationVersion(string $version): void
    {
        if (self::isCliApp()) {
            self::$APPLICATION_VERSION = $version;
        } else {
            MSession::set(MCoreApplication::APPLICATION_VERSION, $version);
        }
    }
544323
public static function unauthorized(string $uri, string $protocol = Protocol::HTTP): self
    {
        return new static(sprintf('Unauthorized: `%s`', $uri), $protocol, 401);
    }