Пример #1
0
 /**
  * @param int $statusCode
  * @param string $reasonPhrase
  * @param string $protocolVersion
  * @param array $headers
  * @param \Psr\Http\Message\StreamInterface $body
  */
 public function __construct($statusCode = 200, $reasonPhrase = '', $protocolVersion = '1.1', array $headers = [], StreamInterface $body = null)
 {
     $this->validStatusCode($statusCode);
     $this->statusCode = $statusCode;
     $this->reasonPhrase = $this->filterReasonPhrase($statusCode, $reasonPhrase);
     parent::__construct($protocolVersion, $headers, $body);
 }
Пример #2
0
 /**
  * @param string $method
  * @param \Psr\Http\Message\UriInterface $uri
  * @param string $protocolVersion
  * @param array $headers
  * @param \Psr\Http\Message\StreamInterface $body
  */
 public function __construct($method = null, UriInterface $uri = null, $protocolVersion = '1.1', array $headers = [], StreamInterface $body = null)
 {
     $this->method = $this->filterMethod($method);
     $this->uri = $uri;
     parent::__construct($protocolVersion, $headers, $body);
 }
Пример #3
0
 /**
  * @param string $method
  * @param \Psr\Http\Message\UriInterface|string $uri
  * @param \Psr\Http\Message\StreamInterface $body
  * @param array $headers
  * @param string $protocolVersion
  */
 public function __construct($method = null, $uri = null, StreamInterface $body = null, array $headers = [], $protocolVersion = '1.1')
 {
     $this->method = $this->filterMethod($method);
     $this->uri = is_string($uri) ? new Uri($uri) : $uri;
     parent::__construct($body, $headers, $protocolVersion);
 }