HTTP Status Value Classes
Introduction
Classes in the GanbaroDigital\HttpStatus\StatusValues
namespace represent the various HTTP status codes. There's one class per supported HTTP status code.
How To Use
Decide which HTTP status code(s) you want to use, and import the corresponding class:
use GanbaroDigital\HttpStatus\StatusValues\Informational\ContinueStatus;
// creates a new HttpStatus that represents the HTTP 100 code
$continueStatus = new ContinueStatus;
echo $continueStatus->getStatusCode() . PHP_EOL;
Informational Status Codes
These classes represent the HTTP 1xx status codes:
Each of these classes implements the GanbaroDigital\HttpStatus\Interfaces\HttpInformationalStatus
interface.
Successful Status Codes
These classes represent the HTTP 2xx status codes:
Each of these classes implements the GanbaroDigital\HttpStatus\Interfaces\HttpSuccessfulStatus
interface.
Redirection Status Codes
These classes represent the HTTP 3xx status codes:
Each of these classes implements the GanbaroDigital\HttpStatus\Interfaces\HttpRedirectionStatus
interface.
RequestError Status Codes
These classes represent the HTTP 4xx status codes:
Each of these classes implements the GanbaroDigital\HttpStatus\Interfaces\HttpRequestErrorStatus
interface.
RuntimeError Status Codes
These classes represent the HTTP 5xx status codes:
Each of these classes implements the GanbaroDigital\HttpStatus\Interfaces\HttpRuntimeErrorStatus
interface.