Skip to content

Commit 7399a89

Browse files
[DependencyInjection] Fix handling of repeated #[Autoconfigure] attributes
1 parent 1baafff commit 7399a89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,9 @@ private function parseDefinition(string $id, $service, string $file, array $defa
448448
return $return ? $alias : $this->container->setAlias($id, $alias);
449449
}
450450

451+
$changes = [];
451452
if (null !== $definition) {
452-
// no-op
453+
$changes = $definition->getChanges();
453454
} elseif ($this->isLoadingInstanceof) {
454455
$definition = new ChildDefinition('');
455456
} elseif (isset($service['parent'])) {
@@ -472,7 +473,7 @@ private function parseDefinition(string $id, $service, string $file, array $defa
472473
$definition->setAutoconfigured($defaults['autoconfigure']);
473474
}
474475

475-
$definition->setChanges([]);
476+
$definition->setChanges($changes);
476477

477478
if (isset($service['class'])) {
478479
$definition->setClass($service['class']);

0 commit comments

Comments
 (0)