From 24c43b2fd3bdb4e95d87ff676e80e6ee2e038dc8 Mon Sep 17 00:00:00 2001 From: Koldo Picaza Date: Thu, 28 Jan 2021 19:25:27 +0100 Subject: [PATCH] fix routing documentation --- docs/framework/routing.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/framework/routing.md b/docs/framework/routing.md index 66a1eb6..628b305 100644 --- a/docs/framework/routing.md +++ b/docs/framework/routing.md @@ -78,15 +78,15 @@ use Psr\Container\ContainerInterface; /** * Setup routes with a single request method: * - * $app->get('/', App\Handler\HomePageHandler::class, 'home'); - * $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create'); - * $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put'); - * $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch'); - * $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete'); + * $app->get('/', [App\Handler\HomePageHandler::class], 'home'); + * $app->post('/album', [App\Handler\AlbumCreateHandler::class], 'album.create'); + * $app->put('/album/:id', [App\Handler\AlbumUpdateHandler::class], 'album.put'); + * $app->patch('/album/:id', [App\Handler\AlbumUpdateHandler::class], 'album.patch'); + * $app->delete('/album/:id', [App\Handler\AlbumDeleteHandler::class], 'album.delete'); * * Or with multiple request methods: * - * $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact'); + * $app->route('/contact', [App\Handler\ContactHandler::class], ['GET', 'POST', ...], 'contact'); */ return static function (Application $app, ContainerInterface $container) : void { $app->get('/', [SomeMiddleware::class, HomePageRequestHandler::class], 'home'); @@ -94,7 +94,7 @@ return static function (Application $app, ContainerInterface $container) : void ```` -The Request Handler must be an implementation of `Psr\RequestHandlerInterface` +The Request Handler must be an implementation of `Psr\Http\Server\RequestHandlerInterface` ````php