8000 Merge pull request #6 from Tobion/hostname-routes · symfony/symfony@17f51a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 17f51a1

Browse files
committed
Merge pull request #6 from Tobion/hostname-routes
fix API of RouteCollection
2 parents 26e5684 + e120a7a commit 17f51a1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Routing/RouteCollection.php

+3-5
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 428C
$route->setHostnamePattern($pattern);
293291
}

0 commit comments

Comments
 (0)
0