You are here

public function MessageTrait::withProtocolVersion in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/MessageTrait.php \Zend\Diactoros\MessageTrait::withProtocolVersion()
  2. 8 vendor/guzzlehttp/psr7/src/MessageTrait.php \GuzzleHttp\Psr7\MessageTrait::withProtocolVersion()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/MessageTrait.php \Zend\Diactoros\MessageTrait::withProtocolVersion()

Return an instance with the specified HTTP protocol version.

The version string MUST contain only the HTTP version number (e.g., "1.1", "1.0").

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new protocol version.

Parameters

string $version HTTP protocol version:

Return value

static

File

vendor/zendframework/zend-diactoros/src/MessageTrait.php, line 71

Class

MessageTrait
Trait implementing the various methods defined in MessageInterface.

Namespace

Zend\Diactoros

Code

public function withProtocolVersion($version) {
  $new = clone $this;
  $new->protocol = $version;
  return $new;
}