fix API of RouteCollection
This commit is contained in:
parent
26e56842dc
commit
e120a7acba
@ -212,7 +212,9 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
// 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 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
{
|
||||
$this->hostnamePattern = (string) $pattern;
|
||||
|
||||
if ('' === $pattern) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->routes as $name => $route) {
|
||||
$route->setHostnamePattern($pattern);
|
||||
}
|
||||
|
Reference in New Issue
Block a user