Skip to content

Commit 3314039

Browse files
authored
Merge pull request #2207 from nicolas-grekas/fix-wiring
Don't use FQCN as service ids
2 parents 92075a9 + a4d9ae0 commit 3314039

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

config/dbal.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
->set('doctrine.dbal.schema_asset_filter_manager', SchemaAssetsFilterManager::class)
8282
->abstract()
8383

84+
->set('doctrine.manager_registry_aware_connection_provider', ManagerRegistryAwareConnectionProvider::class)
85+
->args([
86+
service('doctrine'),
87+
])
88+
8489
->set('doctrine.database_create_command', CreateDatabaseDoctrineCommand::class)
8590
->args([
8691
service('doctrine'),
@@ -93,13 +98,13 @@
9398
])
9499
->tag('console.command', ['command' => 'doctrine:database:drop'])
95100

96-
->set(RunSqlCommand::class)
101+
->set('doctrine.run_sql_command', RunSqlCommand::class)
97102
->args([
98-
service(ManagerRegistryAwareConnectionProvider::class)->nullOnInvalid(),
103+
service('doctrine.manager_registry_aware_connection_provider'),
99104
])
100105
->tag('console.command', ['command' => 'dbal:run-sql'])
101106

102-
->set(ProfilerController::class)
107+
->set('doctrine.profiler_controller', ProfilerController::class)
103108
->args([
104109
service('twig'),
105110
service('doctrine'),

src/DependencyInjection/Compiler/RemoveProfilerControllerPass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler;
66

7-
use Doctrine\Bundle\DoctrineBundle\Controller\ProfilerController;
87
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
98
use Symfony\Component\DependencyInjection\ContainerBuilder;
109

@@ -17,6 +16,6 @@ public function process(ContainerBuilder $container): void
1716
return;
1817
}
1918

20-
$container->removeDefinition(ProfilerController::class);
19+
$container->removeDefinition('doctrine.profiler_controller');
2120
}
2221
}

src/DependencyInjection/DoctrineExtension.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Doctrine\Bundle\DoctrineBundle\Attribute\AsMiddleware;
1010
use Doctrine\Bundle\DoctrineBundle\CacheWarmer\DoctrineMetadataCacheWarmer;
1111
use Doctrine\Bundle\DoctrineBundle\ConnectionFactory;
12-
use Doctrine\Bundle\DoctrineBundle\Dbal\ManagerRegistryAwareConnectionProvider;
1312
use Doctrine\Bundle\DoctrineBundle\Dbal\RegexSchemaAssetFilter;
1413
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\IdGeneratorPass;
1514
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass;
@@ -639,11 +638,6 @@ private function loadDbalConnection(string $name, array $connection, ContainerBu
639638
$def->setClass($options['wrapperClass']);
640639
}
641640

642-
$container->setDefinition(
643-
ManagerRegistryAwareConnectionProvider::class,
644-
new Definition(ManagerRegistryAwareConnectionProvider::class, [$container->getDefinition('doctrine')]),
645-
);
646-
647641
$configuration->addMethodCall('setSchemaManagerFactory', [new Reference($connection['schema_manager_factory'])]);
648642

649643
if (! isset($connection['result_cache'])) {

templates/Collector/db.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
{% block panel %}
9090
{% if 'explain' == page %}
91-
{{ render(controller('Doctrine\\Bundle\\DoctrineBundle\\Controller\\ProfilerController::explainAction', {
91+
{{ render(controller('doctrine.profiler_controller::explainAction', {
9292
token: token,
9393
panel: 'db',
9494
connectionName: request.query.get('connection'),

0 commit comments

Comments
 (0)