phasync
Response / withStatus

Method

Response::withStatus

Returns a copy with the status $code, and $reasonPhrase, or the standard phrase for the code when it is ''.

Description#

public Response::withStatus(
    $code,
    $reasonPhrase = ''
): ResponseInterface

Parameters#

$code
$reasonPhrase = ''

Return values#

ResponseInterface

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionFor a status code that is not an integer from 100 to 599