merged branch Tobion/collection-hostname (PR #6018)
This PR was squashed before being merged into the master branch (closes #6018).
Commits
-------
6334343
[Routing] removed getHostnamePattern from RouteCollection
Discussion
----------
[Routing] removed getHostnamePattern from RouteCollection
this method is not useful and can introduce inconsistencies when a sub-route has a different hostname, which already has a getter for the hostname
This commit is contained in:
commit
e3f8d2db33
@ -46,11 +46,6 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
private $parent;
|
private $parent;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $hostnamePattern = '';
|
|
||||||
|
|
||||||
public function __clone()
|
public function __clone()
|
||||||
{
|
{
|
||||||
foreach ($this->routes as $name => $route) {
|
foreach ($this->routes as $name => $route) {
|
||||||
@ -274,24 +269,12 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the hostname pattern.
|
* Sets the hostname pattern on all child routes.
|
||||||
*
|
|
||||||
* @return string The pattern
|
|
||||||
*/
|
|
||||||
public function getHostnamePattern()
|
|
||||||
{
|
|
||||||
return $this->hostnamePattern;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the hostname pattern on this collection and all children.
|
|
||||||
*
|
*
|
||||||
* @param string $pattern The pattern
|
* @param string $pattern The pattern
|
||||||
*/
|
*/
|
||||||
public function setHostnamePattern($pattern)
|
public function setHostnamePattern($pattern)
|
||||||
{
|
{
|
||||||
$this->hostnamePattern = (string) $pattern;
|
|
||||||
|
|
||||||
foreach ($this->routes as $name => $route) {
|
foreach ($this->routes as $name => $route) {
|
||||||
$route->setHostnamePattern($pattern);
|
$route->setHostnamePattern($pattern);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user