A mutable object representing the PHP response to be sent from the server; use
it in place of the header()
, setcookie()
, setrawcookie()
, etc. functions.
It provides a retention space for the HTTP response version, code, headers,
cookies, and content, so they can be inspected before sending.
Note that Response can be extended to provide other userland functionality. However, its public methods are final; they cannot be modified or overridden.
Instantation is straightforward:
use Sapien\Response;
$response = new Response();
Response has no public properties.
Response implements ResponseInterface, which has these public
methods; all of them are declared final
and so may not be overridden.