You are here

public function Response::__construct in Auth0 Single Sign On 8.2

Parameters

int $status Status code:

array $headers Response headers:

string|null|resource|StreamInterface $body Response body:

string $version Protocol version:

string|null $reason Reason phrase (when empty a default will be used based on the status code):

File

vendor/guzzlehttp/psr7/src/Response.php, line 89

Class

Response
PSR-7 response implementation.

Namespace

GuzzleHttp\Psr7

Code

public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null) {
  $this
    ->assertStatusCodeIsInteger($status);
  $status = (int) $status;
  $this
    ->assertStatusCodeRange($status);
  $this->statusCode = $status;
  if ($body !== '' && $body !== null) {
    $this->stream = stream_for($body);
  }
  $this
    ->setHeaders($headers);
  if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
    $this->reasonPhrase = self::$phrases[$this->statusCode];
  }
  else {
    $this->reasonPhrase = (string) $reason;
  }
  $this->protocol = $version;
}