I’ve just installed Zend Expressive 3 RC1 and I would like to know if I’m wrong on my comprehension of PSR-15.
The basic routes are :
$app->get('/', App\Handler\HomePageHandler::class, 'home'); $app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping');
The registered middlewares for those routes implements RequestHandlerInterface, not MiddlewareInterface.
In this case, I think the classes implements RequestHandlerInterface because it returns directly a response.
return new HtmlResponse($this->template->render('app::home-page', $data)); return new JsonResponse(['ack' => time()]);
but I could have achieved the same thing with a class implementing MiddlewareInterface ?!
So if I don’t need to call another middleware I can use a class implementing RequestHandlerInterface otherwise MiddlewareInterface.
Am I wrong ?