Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e120a7a

Browse files
committed
fix API of RouteCollection
1 parent 26e5684 commit e120a7a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Routing/RouteCollection.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ public function addCollection(RouteCollection $collection, $prefix = '', $defaul
212212
// necessarily already have it applied (depending on the order RouteCollections are added to each other)
213213
$collection->addPrefix($this->getPrefix() . $prefix, $defaults, $requirements, $options);
214214

215-
$collection->setHostnamePattern($hostnamePattern);
215+
if ('' !== $hostnamePattern) {
216+
$collection->setHostnamePattern($hostnamePattern);
217+
}
216218

217219
$this->routes[] = $collection;
218220
}
@@ -284,10 +286,6 @@ public function setHostnamePattern($pattern)
284286
{
285287
$this->hostnamePattern = (string) $pattern;
286288

287-
if ('' === $pattern) {
288-
return;
289-
}
290-
291289
foreach ($this->routes as $name => $route) {
292290
$route->setHostnamePattern($pattern);
293291
}

0 commit comments

Comments
 (0)