Property | Type | Description | |
---|---|---|---|
$method | The HTTP method (commonly GET, POST, PUT, DELETE, HEAD) | ||
$params | A numeric array containing valid URL parameters. For a route path like /users/*, a Request for /users/alganet should have an array equivalent to ['alganet'] | ||
$route | A route matched for this request | ||
$uri | The called URI |
Method | Description | |
---|---|---|
__construct ( string $method = null, string $uri = null ) | ||
__toString ( ) | Converting this request to string dispatch | |
forward ( Respect\Rest\Routes\AbstractRoute $route ) : Response | Forwards a route | |
response ( ) : string | Generates and returns the response from the current route | |
routineCall ( string $type, string $method, Respect\Rest\Routines\Routinable $routine, array &$params ) : mixed | Calls a routine on the current route and returns its result |
Method | Description | |
---|---|---|
catchExceptions ( Exception $e ) : mixed | Does a catch-like operation on an exception based on previously declared instances from Router::exceptionRoute | |
extractRouteParam ( ReflectionFunctionAbstract $callback, ReflectionParameter $routeParam, array &$params ) : mixed | Extracts a parameter value from the current route | |
forwardErrors ( mixed $errorHandler ) : mixed | Restores the previous error handler if present then check error routes for logged errors, forwarding them or returning null silently | |
prepareForErrorForwards ( ) : mixed | Declares an error handler for a single Router::errorRoute instance on the fly before dispatching the request, so the application can capture the errors. These are cleaned after dispatching by forwardErrors() | |
processPosRoutines ( $response ) : mixed | Iterates over routines to find instances of Respect\Rest\Routines\ProxyableThrough and call them, forwarding if necessary | |
processPreRoutines ( ) : mixed | Iterates over routines to find instances of Respect\Rest\Routines\ProxyableBy and call them, forwarding if necessary |
public __construct ( string $method = null, string $uri = null ) | ||
$method | string | The HTTP method |
$uri | string | The called URI |
protected catchExceptions ( Exception $e ) : mixed | ||
$e | Exception | Any exception |
return | mixed | A route forwarding or a silent null |
protected extractRouteParam ( ReflectionFunctionAbstract $callback, ReflectionParameter $routeParam, array &$params ) : mixed | ||
$callback | ReflectionFunctionAbstract | Any function reflection |
$routeParam | ReflectionParameter | Any parameter reflection |
$params | array | Request URI params |
return | mixed | a value from the reflected param |
public forward ( Respect\Rest\Routes\AbstractRoute $route ) : Response | ||
$route | Respect\Rest\Routes\AbstractRoute | Any route |
return | Response | from the forwarded route |
protected forwardErrors ( mixed $errorHandler ) : mixed | ||
$errorHandler | mixed | Some error handler (internal or external to Respect) |
return | mixed | A route forwarding or a silent null |
protected prepareForErrorForwards ( ) : mixed | ||
return | mixed | The previous error handler |
protected processPosRoutines ( $response ) : mixed | ||
return | mixed | A route forwarding or false |
protected processPreRoutines ( ) : mixed | ||
return | mixed | A route forwarding or false |
public routineCall ( string $type, string $method, Respect\Rest\Routines\Routinable $routine, array &$params ) : mixed | ||
$type | string | The name of the routine (accept, when, etc) |
$method | string | The method name (GET, HEAD, POST, etc) |
$routine | Respect\Rest\Routines\Routinable | Some routine instance |
$params | array | Params from the routine |
return | mixed | Whatever the routine returns |
public $params |