Skip to content

Commit 77d7906

Browse files
committed
merged branch Tobion/request-stack-bc (PR #9059)
This PR was merged into the master branch. Discussion ---------- [HttpKernel] made request stack feature BC | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8904 see comments | License | MIT Commits ------- 08a42e7 [HttpKernel] made request stack feature BC
2 parents f5e4c07 + 08a42e7 commit 77d7906

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Symfony/Component/HttpFoundation/RequestStack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public function push(Request $request)
4242
* This method should generally not be called directly as the stack
4343
* management should be taken care of by the application itself.
4444
*
45-
* @return Request
45+
* @return Request|null
4646
*/
4747
public function pop()
4848
{
4949
if (!$this->requests) {
50-
throw new \LogicException('Unable to pop a Request as the stack is already empty.');
50+
return null;
5151
}
5252

5353
return array_pop($this->requests);

src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function onKernelRequest(GetResponseEvent $event)
7878
public function onKernelFinishRequest(FinishRequestEvent $event)
7979
{
8080
if (null === $this->requestStack) {
81-
throw new \LogicException('You must pass a RequestStack.');
81+
return; // removed when requestStack is required
8282
}
8383

8484
if (null !== $parentRequest = $this->requestStack->getParentRequest()) {

src/Symfony/Component/HttpKernel/EventListener/RouterListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setRequest(Request $request = null)
9494
public function onKernelFinishRequest(FinishRequestEvent $event)
9595
{
9696
if (null === $this->requestStack) {
97-
throw new \LogicException('You must pass a RequestStack.');
97+
return; // removed when requestStack is required
9898
}
9999

100100
$this->setRequest($this->requestStack->getParentRequest());

src/Symfony/Component/Security/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.3",
2020
"symfony/event-dispatcher": "~2.1",
21-
"symfony/http-foundation": "~2.4",
21+
"symfony/http-foundation": "~2.1",
2222
"symfony/http-kernel": "~2.4"
2323
},
2424
"require-dev": {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy