\app\framework\Component\Route\KleinHttpStatus

HttpStatus

HTTP status code and message translator

Summary

Methods
Properties
Constants
__construct()
getCode()
getMessage()
setCode()
setMessage()
getFormattedString()
__toString()
getMessageFromCode()
No public properties found
No constants found
No protected methods found
$code
$message
$http_messages
N/A
No private methods found
No private properties found
N/A

Properties

$code

$code : 

The HTTP status code

Type

$message

$message : 

The HTTP status message

Type

$http_messages

$http_messages : 

HTTP 1.1 status messages based on code

Type

Methods

__construct()

__construct(integer  $code, string  $message = null) 

Constructor

Parameters

integer $code

The HTTP code

string $message

(optional) HTTP message for the corresponding code

getCode()

getCode() : integer

Get the HTTP status code

Returns

integer

getMessage()

getMessage() : string

Get the HTTP status message

Returns

string

getFormattedString()

getFormattedString() : string

Get a string representation of our HTTP status

Returns

string

__toString()

__toString() : string

Magic "__toString" method

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

getMessageFromCode()

getMessageFromCode(integer  $int) : string|null

Get our HTTP 1.1 message from our passed code

Returns null if no corresponding message was found for the passed in code

Parameters

integer $int

Returns

string|null