Property | Type | Description | |
---|---|---|---|
$httpStatus |
Method | Description | |
---|---|---|
__construct ( Traversable | array $statusArray = [] ) | Create a new Httpstatus Instance. | |
count ( ) | ||
getIterator ( ) | ||
getReasonPhrase ( string $statusCode ) : string | Get the text for a given status code. | |
getResponseClass ( integer $statusCode ) : integer | Determines the response class of a response code. | |
getStatusCode ( string $statusText ) : string | Get the code for a given status text. | |
hasReasonPhrase ( integer $statusText ) : boolean | Check if the hasReasonPhrase exists in a collection. | |
hasStatusCode ( integer $statusCode ) : boolean | Check if the code exists in a collection. | |
mergeHttpStatus ( integer $code, string $text ) | Add or Update the HTTP Status array. |
Method | Description | |
---|---|---|
fetchStatusCode ( string $text ) : mixed | Fetch the status code for a given reason phrase. | |
filterCollection ( Traversable | array $collection ) : Traversable | array | Filter a Collection array. | |
filterReasonPhrase ( string $text ) : string | Filter a Reason Phrase. | |
filterStatusCode ( integer $code ) : integer | Filter a HTTP Status code. |
public __construct ( Traversable | array $statusArray = [] ) | ||
$statusArray | Traversable | array | a collection of HTTP status code and their associated reason phrase |
protected fetchStatusCode ( string $text ) : mixed | ||
$text | string | the reason phrase |
return | mixed |
protected filterCollection ( Traversable | array $collection ) : Traversable | array | ||
$collection | Traversable | array | |
return | Traversable | array |
protected filterReasonPhrase ( string $text ) : string | ||
$text | string | |
return | string |
protected filterStatusCode ( integer $code ) : integer | ||
$code | integer | |
return | integer |
public getReasonPhrase ( string $statusCode ) : string | ||
$statusCode | string | http status code |
return | string | Returns text for the given status code |
public getResponseClass ( integer $statusCode ) : integer | ||
$statusCode | integer | |
return | integer |
public getStatusCode ( string $statusText ) : string | ||
$statusText | string | http status text |
return | string | Returns code for the given status text |
public hasReasonPhrase ( integer $statusText ) : boolean | ||
$statusText | integer | http status text |
return | boolean | true|false |
public hasStatusCode ( integer $statusCode ) : boolean | ||
$statusCode | integer | http status code |
return | boolean | true|false |
public mergeHttpStatus ( integer $code, string $text ) | ||
$code | integer | a HTTP status Code |
$text | string | a associated reason phrase |