Class ForwardedOperationDispatcher
A dispatcher for forwarded operations.
- ICanBoogie\Module\ForwardedOperationDispatcher implements ICanBoogie\HTTP\Dispatcher
Methods summary
public
__invoke( ICanBoogie\HTTP\Request $request
)
: ICanBoogie\Operation\Response
Returns
Inheritdoc
public
rescue( Exception $exception
, ICanBoogie\HTTP\Request $request
)
If the exception in not a Failure instance it is rethrown, otherwise it means that an exception occurred during control/validate/process or a Failure was thrown because the response has an error.
If the exception in not a Failure instance it is rethrown, otherwise it means that an exception occurred during control/validate/process or a Failure was thrown because the response has an error.
If the request is an XHR we return the response of the operation.
Otherwise, the exception message is logged as an error and no response is returned so that the actual content of the URL is displayed.
Inheritdoc
protected
assert_forward_is_valid( ICanBoogie\HTTP\Request $request
)
Asserts that a forward is valid.
Asserts that a forward is valid.
Parameters
$request
Throws
if ICanBoogie\Module\Operation::DESTINATION or ICanBoogie\Module\Operation::NAME is not defined.
protected
resolve_operation( ICanBoogie\HTTP\Request $request
)
: ICanBoogie\Operation
Resolves an ICanBoogie\Operation instance from forwarded parameters.
Resolves an ICanBoogie\Operation instance from forwarded parameters.
Parameters
$request
Returns
protected
resolve_operation_constructor( string $operation_name
, ICanBoogie\Module
$module
)
: callable
Resolves operation constructor.
Resolves operation constructor.
Parameters
$operation_name
$module
Returns
Throws
If the ICanBoogie\Operation instance cannot be resolved.