PHP Класс Phly\Http\Response

Responses are considered immutable; all methods that might change state are implemented such that they retain the internal state of the current message and return a new instance that contains the changed state.
Наследование: implements Psr\Http\Message\ResponseInterface, use trait MessageTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $body = 'php://memory', integer $status = 200, array $headers = [] )
getReasonPhrase ( )
getStatusCode ( )
withStatus ( $code, $reasonPhrase = '' )

Приватные методы

Метод Описание
assertHeaders ( array $headers ) Ensure header names and values are valid.
validateStatus ( integer | string $code ) Validate a status code.

Описание методов

__construct() публичный Метод

public __construct ( $body = 'php://memory', integer $status = 200, array $headers = [] )
$status integer Status code for the response, if any.
$headers array Headers for the response, if any.

getReasonPhrase() публичный Метод

public getReasonPhrase ( )

getStatusCode() публичный Метод

public getStatusCode ( )

withStatus() публичный Метод

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