Permalink
Browse files

fix API of RouteCollection

  • Loading branch information...
1 parent 26e5684 commit e120a7acba03176ae0340e457d594f59b835c0ce @Tobion Tobion committed Nov 12, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/Symfony/Component/Routing/RouteCollection.php
@@ -212,7 +212,9 @@ public function addCollection(RouteCollection $collection, $prefix = '', $defaul
// necessarily already have it applied (depending on the order RouteCollections are added to each other)
$collection->addPrefix($this->getPrefix() . $prefix, $defaults, $requirements, $options);
- $collection->setHostnamePattern($hostnamePattern);
+ if ('' !== $hostnamePattern) {
+ $collection->setHostnamePattern($hostnamePattern);
+ }
$this->routes[] = $collection;
}
@@ -284,10 +286,6 @@ public function setHostnamePattern($pattern)
{
$this->hostnamePattern = (string) $pattern;
- if ('' === $pattern) {
- return;
- }
-
foreach ($this->routes as $name => $route) {
$route->setHostnamePattern($pattern);
}

0 comments on commit e120a7a

Please sign in to comment.