N°5809 Update Symfony artifacts from 6.4.0 to 6.4.2

symfony/console
symfony/dotenv
symfony/framework-bundle
symfony/http-foundation
symfony/http-kernel
symfony/var-dumper
symfony/web-profiler-bundle
This commit is contained in:
Pierre Goiffon
2024-01-26 09:55:51 +01:00
parent ddce3058be
commit dfb5a4875a
110 changed files with 1115 additions and 929 deletions

View File

@@ -19,7 +19,7 @@ if (false) {
/**
* @deprecated since Symfony 6.4, to be removed in 7.0, use {@link AttributeClassLoader} instead
*/
class AnnotationClassLoader
abstract class AnnotationClassLoader extends AttributeClassLoader
{
}
}

View File

@@ -19,7 +19,7 @@ if (false) {
/**
* @deprecated since Symfony 6.4, to be removed in 7.0, use {@link AttributeDirectoryLoader} instead
*/
class AnnotationDirectoryLoader
class AnnotationDirectoryLoader extends AttributeDirectoryLoader
{
}
}

View File

@@ -19,7 +19,7 @@ if (false) {
/**
* @deprecated since Symfony 6.4, to be removed in 7.0, use {@link AttributeFileLoader} instead
*/
class AnnotationFileLoader
class AnnotationFileLoader extends AttributeFileLoader
{
}
}

View File

@@ -144,7 +144,9 @@ abstract class AttributeClassLoader implements LoaderInterface
if (1 === $collection->count() - \count($routeNamesBefore)) {
$newRouteName = current(array_diff(array_keys($collection->all()), $routeNamesBefore));
$collection->addAlias(sprintf('%s::%s', $class->name, $method->name), $newRouteName);
if ($newRouteName !== $aliasName = sprintf('%s::%s', $class->name, $method->name)) {
$collection->addAlias($aliasName, $newRouteName);
}
}
}
if (0 === $collection->count() && $class->hasMethod('__invoke')) {
@@ -155,8 +157,14 @@ abstract class AttributeClassLoader implements LoaderInterface
}
}
if ($fqcnAlias && 1 === $collection->count()) {
$collection->addAlias($class->name, $invokeRouteName = key($collection->all()));
$collection->addAlias(sprintf('%s::__invoke', $class->name), $invokeRouteName);
$invokeRouteName = key($collection->all());
if ($invokeRouteName !== $class->name) {
$collection->addAlias($class->name, $invokeRouteName);
}
if ($invokeRouteName !== $aliasName = sprintf('%s::__invoke', $class->name)) {
$collection->addAlias($aliasName, $invokeRouteName);
}
}
if ($this->hasDeprecatedAnnotations) {

View File

@@ -147,9 +147,24 @@ class RouteCollection implements \IteratorAggregate, \Countable
*/
public function remove(string|array $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]);
}
}
}
/**