Skip to content

Commit 44d66f0

Browse files
nicolas-grekasostrolucky
authored andcommitted
Add proper target names to autowiring aliases
1 parent 76433a2 commit 44d66f0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/DependencyInjection/DoctrineExtension.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,7 @@ private function loadDbalConnection(string $name, array $connection, ContainerBu
632632
]);
633633

634634
$container
635-
->registerAliasForArgument($connectionId, Connection::class, sprintf('%s.connection', $name))
636-
->setPublic(false);
635+
->registerAliasForArgument($connectionId, Connection::class, sprintf('%s.connection', $name), $name);
637636

638637
// Set class in case "wrapper_class" option was used to assist IDEs
639638
if (isset($options['wrapperClass'])) {
@@ -1022,8 +1021,7 @@ private function loadOrmEntityManager(array $entityManager, ContainerBuilder $co
10221021
->setConfigurator([new Reference($managerConfiguratorName), 'configure']);
10231022

10241023
$container
1025-
->registerAliasForArgument($entityManagerId, EntityManagerInterface::class, sprintf('%s.entity_manager', $entityManager['name']))
1026-
->setPublic(false);
1024+
->registerAliasForArgument($entityManagerId, EntityManagerInterface::class, sprintf('%s.entity_manager', $entityManager['name']), $entityManager['name']);
10271025

10281026
$container->setAlias(
10291027
sprintf('doctrine.orm.%s_entity_manager.event_manager', $entityManager['name']),

0 commit comments

Comments
 (0)