From 33e449cb7e6895a373a96bbedafffc51fa3063bb Mon Sep 17 00:00:00 2001 From: Liu Date: Tue, 1 Aug 2023 09:22:46 +0800 Subject: [PATCH] Update dependency-injection.md --- docs/5.x/dependency-injection.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/5.x/dependency-injection.md b/docs/5.x/dependency-injection.md index 9aa7d0a..2046729 100644 --- a/docs/5.x/dependency-injection.md +++ b/docs/5.x/dependency-injection.md @@ -74,8 +74,9 @@ $container = new League\Container\Container; $container->add(Acme\SomeController::class)->addArgument(Acme\TemplateRenderer::class); $container->add(Acme\TemplateRenderer::class); -$strategy = (new League\Route\Strategy\ApplicationStrategy)->setContainer($container); -$router = (new League\Route\Router)->setStrategy($strategy); +$strategy = new League\Route\Strategy\ApplicationStrategy; +$strategy->setContainer($container); +$router = (new League\Route\Router)->setStrategy($strategy); $router->map('GET', '/', Acme\SomeController::class); ~~~