class Dispatcher (View source)

A command dispatcher.

Properties

protected Dispatcher $signalDispatcher
protected ObjectManagerInterface $objectManager

Methods

injectSignalDispatcher(Dispatcher $signalDispatcher)

No description

injectObjectManager(ObjectManagerInterface $objectManager)

No description

dispatch(Request $request, Response $response)

Try processing the request until it is successfully marked "dispatched"

void
emitBeforeControllerInvocation(Request $request, Response $response, CommandControllerInterface $controller)

This signal is emitted directly before the request is been dispatched to a controller.

void
emitAfterControllerInvocation(Request $request, Response $response, CommandControllerInterface $controller)

This signal is emitted directly after the request has been dispatched to a controller and the controller returned control back to the dispatcher.

resolveController(Request $request)

Finds and instantiates a controller that matches the current request.

Details

injectSignalDispatcher(Dispatcher $signalDispatcher)

No description

Parameters

Dispatcher $signalDispatcher

injectObjectManager(ObjectManagerInterface $objectManager)

No description

Parameters

ObjectManagerInterface $objectManager

Response dispatch(Request $request, Response $response)

Try processing the request until it is successfully marked "dispatched"

Parameters

Request $request
Response $response

Return Value

Response

Exceptions

InfiniteLoopException
InvalidCommandControllerException

protected void emitBeforeControllerInvocation(Request $request, Response $response, CommandControllerInterface $controller)

This signal is emitted directly before the request is been dispatched to a controller.

Parameters

Request $request
Response $response
CommandControllerInterface $controller

Return Value

void

protected void emitAfterControllerInvocation(Request $request, Response $response, CommandControllerInterface $controller)

This signal is emitted directly after the request has been dispatched to a controller and the controller returned control back to the dispatcher.

Parameters

Request $request
Response $response
CommandControllerInterface $controller

Return Value

void

protected CommandControllerInterface resolveController(Request $request)

Finds and instantiates a controller that matches the current request.

If no controller can be found, an instance of NotFoundControllerInterface is returned.

Parameters

Request $request

The request to dispatch

Return Value

CommandControllerInterface

Exceptions

InvalidCommandControllerException