From 08a42e7e794d229e1939d72cde5296420478a7ef Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 17 Sep 2013 18:23:22 +0200 Subject: [PATCH] [HttpKernel] made request stack feature BC --- src/Symfony/Component/HttpFoundation/RequestStack.php | 4 ++-- .../Component/HttpKernel/EventListener/LocaleListener.php | 2 +- .../Component/HttpKernel/EventListener/RouterListener.php | 2 +- src/Symfony/Component/Security/composer.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/RequestStack.php b/src/Symfony/Component/HttpFoundation/RequestStack.php index 71bfd10699..4b0ef28dee 100644 --- a/src/Symfony/Component/HttpFoundation/RequestStack.php +++ b/src/Symfony/Component/HttpFoundation/RequestStack.php @@ -42,12 +42,12 @@ class RequestStack * This method should generally not be called directly as the stack * management should be taken care of by the application itself. * - * @return Request + * @return Request|null */ public function pop() { if (!$this->requests) { - throw new \LogicException('Unable to pop a Request as the stack is already empty.'); + return null; } return array_pop($this->requests); diff --git a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php index aa9c73efa9..bdcf4c7644 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php @@ -78,7 +78,7 @@ class LocaleListener implements EventSubscriberInterface public function onKernelFinishRequest(FinishRequestEvent $event) { if (null === $this->requestStack) { - throw new \LogicException('You must pass a RequestStack.'); + return; // removed when requestStack is required } if (null !== $parentRequest = $this->requestStack->getParentRequest()) { diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php index 3c2302e986..7514aa39e7 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -94,7 +94,7 @@ class RouterListener implements EventSubscriberInterface public function onKernelFinishRequest(FinishRequestEvent $event) { if (null === $this->requestStack) { - throw new \LogicException('You must pass a RequestStack.'); + return; // removed when requestStack is required } $this->setRequest($this->requestStack->getParentRequest()); diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index fe1299c170..9c01ef065d 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=5.3.3", "symfony/event-dispatcher": "~2.1", - "symfony/http-foundation": "~2.4", + "symfony/http-foundation": "~2.1", "symfony/http-kernel": "~2.4" }, "require-dev": {