Related to #2050
Will become:
$app->get('/foo', function (ServerRequest $request, array $args) {
// Return response object
});
If you're going to continue using the array $args by default I'd recommend not adding them as request attributes. See #2019
If you're going to continue using the array $args by default I'd recommend not adding them as request attributes. See #2019
We should look at that, certainly.
The route callable's signature is configuration via a strategy, so this ticket is for creating the new strategy to more closely match the PSR-15 signature.
Hi!
According to the accepted PSR-15 specification the new signature should look like this.
$app->get('/foo', function (ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
$response = $handler->handle($request);
// Do something...
// Return response object
return $response;
});
Is this correct? Will the signature in Slim version 4 look like this?
@odan Yes - see https://github.com/slimphp/Slim/pull/2379
Fixed in #2497
Most helpful comment
We should look at that, certainly.
The route callable's signature is configuration via a strategy, so this ticket is for creating the new strategy to more closely match the PSR-15 signature.