Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -89,7 +89,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
/**
* @param int $priority
*/
public function add(string $name, Route $route/*, int $priority = 0*/)
public function add(string $name, Route $route/* , int $priority = 0 */)
{
if (\func_num_args() < 3 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface && !$this instanceof \Mockery\MockInterface) {
trigger_deprecation('symfony/routing', '5.1', 'The "%s()" method will have a new "int $priority = 0" argument in version 6.0, not defining it is deprecated.', __METHOD__);
@@ -157,9 +157,24 @@ class RouteCollection implements \IteratorAggregate, \Countable
*/
public function remove($name)
{
$routes = [];
foreach ((array) $name as $n) {
if (isset($this->routes[$n])) {
$routes[] = $n;
}
unset($this->routes[$n], $this->priorities[$n], $this->aliases[$n]);
}
if (!$routes) {
return;
}
foreach ($this->aliases as $k => $alias) {
if (\in_array($alias->getId(), $routes, true)) {
unset($this->aliases[$k]);
}
}
}
/**
@@ -380,4 +395,9 @@ class RouteCollection implements \IteratorAggregate, \Countable
{
return $this->aliases[$name] ?? null;
}
public function getPriority(string $name): ?int
{
return $this->priorities[$name] ?? null;
}
}