Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 473c605

Browse filesBrowse files
committed
Ref symfony#15: Added small comment + get context outside of foreach loop
1 parent 8fe672e commit 473c605
Copy full SHA for 473c605

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎ChainRouter.php

Copy file name to clipboardExpand all lines: ChainRouter.php
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ public function all()
9191
if (empty($this->sortedRouters)) {
9292
$this->sortedRouters = $this->sortRouters();
9393

94+
// setContext() is done here instead of in add() to avoid fatal errors when clearing and warming up caches
95+
// See https://github.com/symfony-cmf/Routing/pull/18
9496
$context = $this->getContext();
95-
foreach ($this->sortedRouters as $router) {
96-
if ($router instanceof RequestContextAwareInterface) {
97-
if (null !== $context) {
97+
if (null !== $context) {
98+
foreach ($this->sortedRouters as $router) {
99+
if ($router instanceof RequestContextAwareInterface) {
98100
$router->setContext($context);
99101
}
100102
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.