Merge branch '4.4'

This commit is contained in:
Tobias Schultze 2019-06-28 14:28:16 +02:00
commit cf8cfebd5e
2 changed files with 7 additions and 1 deletions

View File

@ -140,6 +140,10 @@ class RouteCollection implements \IteratorAggregate, \Countable
*/
public function addPrefix($prefix, array $defaults = [], array $requirements = [])
{
if (null === $prefix) {
@trigger_error(sprintf('Passing null as $prefix to %s is deprecated in Symfony 4.4 and will trigger a TypeError in 5.0.', __METHOD__), E_USER_DEPRECATED);
}
$prefix = trim(trim($prefix), '/');
if ('' === $prefix) {

View File

@ -309,7 +309,9 @@ class RouteCollectionBuilder
} else {
/* @var self $route */
$subCollection = $route->build();
$subCollection->addPrefix($this->prefix);
if (null !== $this->prefix) {
$subCollection->addPrefix($this->prefix);
}
$routeCollection->addCollection($subCollection);
}