updated-packages
This commit is contained in:
@@ -15,6 +15,7 @@ use Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator;
|
||||
use Symfony\Component\Routing\Loader\Configurator\RouteConfigurator;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\RouteCompiler;
|
||||
|
||||
trait AddTrait
|
||||
{
|
||||
@@ -34,7 +35,7 @@ trait AddTrait
|
||||
*/
|
||||
final public function add(string $name, $path): RouteConfigurator
|
||||
{
|
||||
$paths = array();
|
||||
$paths = [];
|
||||
$parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);
|
||||
|
||||
if (\is_array($path)) {
|
||||
@@ -67,6 +68,7 @@ trait AddTrait
|
||||
$routes->add($name.'.'.$locale, $route = $this->createRoute($path));
|
||||
$this->collection->add($this->name.$name.'.'.$locale, $route);
|
||||
$route->setDefault('_locale', $locale);
|
||||
$route->setRequirement('_locale', preg_quote($locale, RouteCompiler::REGEX_DELIMITER));
|
||||
$route->setDefault('_canonical_route', $this->name.$name);
|
||||
}
|
||||
|
||||
@@ -83,7 +85,7 @@ trait AddTrait
|
||||
return $this->add($name, $path);
|
||||
}
|
||||
|
||||
private function createRoute($path): Route
|
||||
private function createRoute(string $path): Route
|
||||
{
|
||||
return new Route($path);
|
||||
}
|
||||
|
Reference in New Issue
Block a user