HTTP status code and message translator
Methods
Constructor
__construct(int $code, string $message) : void
Parameters
$message
string
(optional) HTTP message for the corresponding code
Magic "__toString" method
__toString() : string
Allows the ability to arbitrarily use an instance of this class as a string
This method will be automatically called, returning a string representation
of this instance
Returns
string
Get the HTTP status code
getCode() : int
Get the HTTP status message
getMessage() : string
Get our HTTP 1.1 message from our passed code
getMessageFromCode(int $int) : string
Static
Returns null if no corresponding message was
found for the passed in code
Parameters
$int
int
Returns
string
| null
Set the HTTP status code
setCode(int $code) : \Klein\HttpStatus
Parameters
$code
int
Returns
Set the HTTP status message
setMessage(string $message) : \Klein\HttpStatus
Parameters
$message
string
Returns
Properties