From 46dbea2b0bd99d7ee686d1729e110a1795b37f99 Mon Sep 17 00:00:00 2001 From: Achilleas Kaloeridis Date: Thu, 21 Apr 2016 20:22:18 +0300 Subject: [PATCH] Update http_kernel_httpkernel_class.rst The current code generates a Fatal Error. I can see in the HttpKernel Component's documentation that RouterListener needs a $matcher and a RequestStack object as paramers. --- create_framework/http_kernel_httpkernel_class.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/create_framework/http_kernel_httpkernel_class.rst b/create_framework/http_kernel_httpkernel_class.rst index be2a2c7a09f..62c11138987 100644 --- a/create_framework/http_kernel_httpkernel_class.rst +++ b/create_framework/http_kernel_httpkernel_class.rst @@ -41,6 +41,7 @@ And the new front controller:: use Symfony\Component\Routing; use Symfony\Component\HttpKernel; use Symfony\Component\EventDispatcher\EventDispatcher; + use Symfony\Component\HttpFoundation\RequestStack; $request = Request::createFromGlobals(); $routes = include __DIR__.'/../src/app.php'; @@ -50,7 +51,7 @@ And the new front controller:: $resolver = new HttpKernel\Controller\ControllerResolver(); $dispatcher = new EventDispatcher(); - $dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher)); + $dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher, new RequestStack())); $framework = new Simplex\Framework($dispatcher, $resolver);