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
We have an implementation of RequestHandlerInterface for every route in our app. We currently have to register them on the router like this (simplified for example):
$helloRequestHandler = new HelloRequestHandler(); // implements RequestHandlerInterface
$router = new Router();
$router->get('/hello', [$helloRequestHandler, 'handle']);
Since RequestHandlerInterface is an interface from PSR-15, and this package supports PSR-15 (middlewares), it would be cool if the router could automatically detect the 'handle' method on the request handlers, so we could just register them like:
$helloRequestHandler = new HelloRequestHandler(); // implements RequestHandlerInterface
$router = new Router();
$router->get('/hello', $helloRequestHandler);
(Or when injecting a dependency container into the router, as a FQN / service name without the ::handle)
Is this something that you would consider approving if I created a PR for this?
The text was updated successfully, but these errors were encountered:
We have an implementation of RequestHandlerInterface for every route in our app. We currently have to register them on the router like this (simplified for example):
Since RequestHandlerInterface is an interface from PSR-15, and this package supports PSR-15 (middlewares), it would be cool if the router could automatically detect the 'handle' method on the request handlers, so we could just register them like:
(Or when injecting a dependency container into the router, as a FQN / service name without the
::handle
)Is this something that you would consider approving if I created a PR for this?
The text was updated successfully, but these errors were encountered: