Trait StatusCodeTrait
Provides a simple means for representing a status code as an object.
Traits provide extended method support to classes without requiring a direct, linear chain of inheritance. This allows functions to inherit subsets of related methods without declaring a parent class.
In Oroboros core, ALL methods are granted to classes via traits, and the classes themselves are just containers that correlate their methods to an interface they are expected to honor. This approach maximizes interoperability, by entirely removing class inheritance as a requirement for extension of any class in this system.
3rd parties using this package are not expected to follow this approach,
but ALL of our internal class and logic structure does.
Direct Known Users
Indirect Known Users
Package: oroboros\core\utilities
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4
Since: 0.2.4-alpha
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Located at core/traits/utilities/http/StatusCodeTrait.php
Methods summary
public
|
#
__construct( integer $code = 200 )
|
public
string
|
|
public
integer
|
|
public
string
|
|
public
|
#
setMessage( mixed $message )
Sets a custom status code title. If this method is not called, the default value will be used. |
protected
|
|
private
|
#
_getValidStatusCodes( )
Initializes the list of valid status codes for the current class, if it has not already occurred. |
private
|
#
_checkStatusCode( integer $code )
Checks if a status code is valid. Will attempt to cast to int if it is scalar and not an integer. |
private
|
#
_setCustomStatusCodeMessage( scalar|object $message )
Sets a custom status code message. Any scalar value may be passed or any object implementing __toString. The result will be cast to a string if it is not already. |
Properties summary
private
integer
|
$_status_code
Represents the status code value. |
#
200
|
private
string
|
$_status_code_title
Represents the status code message. |
|
private static
oroboros\core\enum\http\StatusCodes
|
$_status_codes_valid
Represents the possible valid status codes. |
|
private static
string
|
$_status_codes_enumerator
Represents the validation enumerator used to check whether a status code is valid or not. |
#
'\\oroboros\\core\\libraries\\enum\\http\\StatusCodes'
|