Method | Description | |
---|---|---|
__construct ( integer $code, string $reason ) | Constructor. | |
isClientError ( ) : boolean | Helper to establish if the class of the status code is client error (4xx). | |
isInformational ( ) : boolean | Helper to establish if the class of the status code is informational (1xx). | |
isRedirection ( ) : boolean | Helper to establish if the class of the status code is redirection (3xx). | |
isServerError ( ) : boolean | Helper to establish if the class of the status code is server error (5xx). | |
isSuccessful ( ) : boolean | Helper to establish if the class of the status code is successful (2xx). | |
reasonPhrase ( ) : string | Return the reason phrase | |
response ( Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface | Add the status code and reason phrase to a Response. | |
statusClass ( ) : integer | Return the status class of the response code. | |
statusCode ( ) : integer | Return the response code. |
Method | Description | |
---|---|---|
isStatusClass ( integer $class ) : boolean | Test whether the response class matches the class passed to it. | |
setCode ( integer $code ) | Set the code. Used in constructor to ensure the code meets the requirements for a status code. |
public __construct ( integer $code, string $reason ) | ||
$code | integer | The response code |
$reason | string | The reason phrase |
public isClientError ( ) : boolean | ||
return | boolean |
public isInformational ( ) : boolean | ||
return | boolean |
public isRedirection ( ) : boolean | ||
return | boolean |
public isServerError ( ) : boolean | ||
return | boolean |
public isSuccessful ( ) : boolean | ||
return | boolean |
public reasonPhrase ( ) : string | ||
return | string |
public response ( Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface | ||
$response | Psr\Http\Message\ResponseInterface | The response |
return | Psr\Http\Message\ResponseInterface |
public statusClass ( ) : integer | ||
return | integer |