You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you be open to adding a call to an intermediary methodin the __invoke method, for example:
public function __invoke(): ResponseInterface
{
// ...
return $this->processResponse($this->invoker->call($callable, $parameters));
}
protected function processResponse($response): ResponseInterface
{
return $response;
}
This would allow for sub-classing for the ControllerInvoker, such that alternative response types could be cast to the ResponseInterface after invocation, for example a controller may return:
public function example(
// ...
): PayloadResponse
{
return new PayloadResponse(
request: $request,
response: $response,
data: ['some', 'data', 'here']
);
}
The text was updated successfully, but these errors were encountered:
I'm looking to modify the ControllerInvoker to allow the route to return a different response which can be converted to a ResponseInterface at a later stage. Specifically I'm looking to implement something like juliangut/slim-routing (https://github.com/juliangut/slim-routing/blob/master/src/Strategy/RequestResponseNamedArgs.php).
Would you be open to adding a call to an intermediary methodin the __invoke method, for example:
This would allow for sub-classing for the ControllerInvoker, such that alternative response types could be cast to the ResponseInterface after invocation, for example a controller may return:
The text was updated successfully, but these errors were encountered: