Response Class

Aurora\Http Namespace

Extends

Interfaces

  • I MessageInterface
  • I ResponseInterface

Properties

phrases

reasonPhrase

Reason phrase

protected $reasonPhrase = '': string

statusCode

Status code

protected $statusCode = 200: int

Constructor

__construct

Parameters

  • mixed $status — Status code for the response, if any.
  • array $headers — Headers for the response, if any.
  • mixed $body — Stream body.
  • mixed $version — Protocol version.
  • mixed $reason — Reason phrase (a default will be used if possible).

Signature

public function __construct(mixed $status = 200, array $headers = [], mixed $body, mixed $version = '1.1', mixed $reason)

Methods

__construct

Parameters

  • mixed $status — Status code for the response, if any.
  • array $headers — Headers for the response, if any.
  • mixed $body — Stream body.
  • mixed $version — Protocol version.
  • mixed $reason — Reason phrase (a default will be used if possible).

Signature

public function __construct(mixed $status = 200, array $headers = [], mixed $body, mixed $version = '1.1', mixed $reason)

getStatusCode

Gets the response status code

Return Value

  • int

Signature

public function getStatusCode()

withStatus

Return an instance with the specified status code and, optionally, reason phrase.

Parameters

  • mixed $code — The 3-digit integer result code to set
  • mixed $reasonPhrase — The reason phrase

Return Value

  • \Response

Signature

public function withStatus(mixed $code, mixed $reasonPhrase = '')

getReasonPhrase

Gets the response reason phrase associated with the status code

Return Value

  • string Reason phrase

Signature

public function getReasonPhrase()

Go to top