PHP Class 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.
Inheritance: implements Psr\Http\Message\ResponseInterface, use trait MessageTrait
Afficher le fichier Open project: phly/http Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $body = 'php://memory', integer $status = 200, array $headers = [] )
getReasonPhrase ( )
getStatusCode ( )
withStatus ( $code, $reasonPhrase = '' )

Private Methods

Méthode Description
assertHeaders ( array $headers ) Ensure header names and values are valid.
validateStatus ( integer | string $code ) Validate a status code.

Method Details

__construct() public méthode

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 méthode

public getReasonPhrase ( )

getStatusCode() public méthode

public getStatusCode ( )

withStatus() public méthode

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