8000 [HttpKernel] made request stack feature BC by Tobion · Pull Request #9059 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] made request stack feature BC #9059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/RequestStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function push(Request $request)
* 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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all other methods return null instead of throwing exception. as there is no method to check wether the stack has elements at all, pop cannot throw exception.

}

return array_pop($this->requests);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function onKernelRequest(GetResponseEvent $event)
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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function setRequest(Request $request = null)
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());
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Security/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
0