Exemple #1
0
 /**
  * Construct a Response object with the given status code, reason phrase, version, headers & body.
  *
  * @param int $statusCode
  * @param string $reasonPhrase = ''
  * @param string $version = self::DEFAULT_VERSION
  * @param array $headers = []
  * @param StreamInterface|null $body = null
  */
 public function __construct($statusCode, $reasonPhrase = '', $version = self::DEFAULT_VERSION, array $headers = [], StreamInterface $body = null)
 {
     parent::__construct($version, $headers, $body);
     $this->setStatus($statusCode, $reasonPhrase);
 }
Exemple #2
0
 /**
  * Construct a Request object with the given method, uri, version, headers & body.
  *
  * @param string $method
  * @param UriInterface $uri
  * @param string $version = self::DEFAULT_VERSION
  * @param array $headers = []
  * @param StreamInterface|null $body = null
  */
 public function __construct($method, UriInterface $uri, $version = self::DEFAULT_VERSION, array $headers = [], StreamInterface $body = null)
 {
     parent::__construct($version, $headers, $body);
     $this->setMethod($method);
     $this->setUri($uri);
 }