PHP Class Zend\Stratigility\Utils

Show file Open project: zendframework/zend-stratigility Class Usage Examples

Public Methods

Method Description
getArity ( string | callable | object $callable ) : integer Get the arity of a handler
getStatusCode ( mixed $error, Psr\Http\Message\ResponseInterface $response ) : integer Determine status code from an error and/or response.

Method Details

getArity() public static method

Get the arity of a handler
public static getArity ( string | callable | object $callable ) : integer
$callable string | callable | object
return integer

getStatusCode() public static method

If the error is an exception with a code between 400 and 599, returns the exception code. Otherwise, retrieves the code from the response; if not present, or less than 400 or greater than 599, returns 500; otherwise, returns it.
public static getStatusCode ( mixed $error, Psr\Http\Message\ResponseInterface $response ) : integer
$error mixed
$response Psr\Http\Message\ResponseInterface
return integer