Skip to content

Commit 491839b

Browse files
author
Amrouche Hamza
committed
[TwigBundle][FrameworkBundle] Remove the internals from debug autowiring
1 parent 219d710 commit 491839b

File tree

8 files changed

+35
-45
lines changed

8 files changed

+35
-45
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

+8-15
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313

1414
use Doctrine\Common\Annotations\Reader;
1515
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
16-
use Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand;
17-
use Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand;
18-
use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand;
19-
use Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand;
20-
use Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand;
21-
use Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand;
22-
use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand;
2316
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2417
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
2518
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
@@ -152,10 +145,10 @@ public function load(array $configs, ContainerBuilder $container)
152145
$loader->load('console.xml');
153146

154147
if (!class_exists(BaseXliffLintCommand::class)) {
155-
$container->removeDefinition(XliffLintCommand::class);
148+
$container->removeDefinition('console.command.xliff_lint');
156149
}
157150
if (!class_exists(BaseYamlLintCommand::class)) {
158-
$container->removeDefinition(YamlLintCommand::class);
151+
$container->removeDefinition('console.command.yaml_lint');
159152
}
160153
}
161154

@@ -251,7 +244,7 @@ public function load(array $configs, ContainerBuilder $container)
251244
$container->removeDefinition('form.type_guesser.validator');
252245
}
253246
} else {
254-
$container->removeDefinition('Symfony\Component\Form\Command\DebugCommand');
247+
$container->removeDefinition('console.command.form_debug');
255248
}
256249

257250
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);
@@ -572,7 +565,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
572565
private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
573566
{
574567
if (!$config['enabled']) {
575-
$container->removeDefinition(WorkflowDumpCommand::class);
568+
$container->removeDefinition('console.command.workflow_dump');
576569

577570
return;
578571
}
@@ -757,8 +750,8 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
757750
private function registerRouterConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
758751
{
759752
if (!$this->isConfigEnabled($container, $config)) {
760-
$container->removeDefinition(RouterDebugCommand::class);
761-
$container->removeDefinition(RouterMatchCommand::class);
753+
$container->removeDefinition('console.command.router_debug');
754+
$container->removeDefinition('console.command.router_match');
762755

763756
return;
764757
}
@@ -1087,8 +1080,8 @@ private function createVersion(ContainerBuilder $container, $version, $format, $
10871080
private function registerTranslatorConfiguration(array $config, ContainerBuilder $container, LoaderInterface $loader)
10881081
{
10891082
if (!$this->isConfigEnabled($container, $config)) {
1090-
$container->removeDefinition(TranslationDebugCommand::class);
1091-
$container->removeDefinition(TranslationUpdateCommand::class);
1083+
$container->removeDefinition('console.command.translation_debug');
1084+
$container->removeDefinition('console.command.translation_update');
10921085

10931086
return;
10941087
}

src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml

+19-19
Original file line numberDiff line numberDiff line change
@@ -13,95 +13,95 @@
1313
<tag name="monolog.logger" channel="console" />
1414
</service>
1515

16-
<service id="Symfony\Bundle\FrameworkBundle\Command\AboutCommand">
16+
<service id="console.command.about" class="Symfony\Bundle\FrameworkBundle\Command\AboutCommand">
1717
<tag name="console.command" command="about" />
1818
</service>
1919

20-
<service id="Symfony\Bundle\FrameworkBundle\Command\AssetsInstallCommand">
20+
<service id="console.command.assets_install" class="Symfony\Bundle\FrameworkBundle\Command\AssetsInstallCommand">
2121
<argument type="service" id="filesystem" />
2222
<tag name="console.command" command="assets:install" />
2323
</service>
2424

25-
<service id="Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand">
25+
<service id="console.command.cache_clear" class="Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand">
2626
<argument type="service" id="cache_clearer" />
2727
<argument type="service" id="filesystem" />
2828
<tag name="console.command" command="cache:clear" />
2929
</service>
3030

31-
<service id="Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand">
31+
<service id="console.command.cache_pool_clear" class="Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand">
3232
<argument type="service" id="cache.global_clearer" />
3333
<tag name="console.command" command="cache:pool:clear" />
3434
</service>
3535

36-
<service id="Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand">
36+
<service id="console.command.cache_pool_prune" class="Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand">
3737
<argument type="iterator" />
3838
<tag name="console.command" command="cache:pool:prune" />
3939
</service>
4040

41-
<service id="Symfony\Bundle\FrameworkBundle\Command\CacheWarmupCommand">
41+
<service id="console.command.cache_warmup" class="Symfony\Bundle\FrameworkBundle\Command\CacheWarmupCommand">
4242
<argument type="service" id="cache_warmer" />
4343
<tag name="console.command" command="cache:warmup" />
4444
</service>
4545

46-
<service id="Symfony\Bundle\FrameworkBundle\Command\ConfigDebugCommand">
46+
<service id="console.command.config_debug" class="Symfony\Bundle\FrameworkBundle\Command\ConfigDebugCommand">
4747
<tag name="console.command" command="debug:config" />
4848
</service>
4949

50-
<service id="Symfony\Bundle\FrameworkBundle\Command\ConfigDumpReferenceCommand">
50+
<service id="console.command.config_dump_reference" class="Symfony\Bundle\FrameworkBundle\Command\ConfigDumpReferenceCommand">
5151
<tag name="console.command" command="config:dump-reference" />
5252
</service>
5353

54-
<service id="Symfony\Bundle\FrameworkBundle\Command\ContainerDebugCommand">
54+
<service id="console.command.container_debug" class="Symfony\Bundle\FrameworkBundle\Command\ContainerDebugCommand">
5555
<tag name="console.command" command="debug:container" />
5656
</service>
5757

58-
<service id="Symfony\Bundle\FrameworkBundle\Command\DebugAutowiringCommand">
58+
<service id="console.command.debug_autowiring" class="Symfony\Bundle\FrameworkBundle\Command\DebugAutowiringCommand">
5959
<tag name="console.command" command="debug:autowiring" />
6060
</service>
6161

62-
<service id="Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand">
62+
<service id="console.command.event_dispatcher_debug" class="Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand">
6363
<argument type="service" id="event_dispatcher" />
6464
<tag name="console.command" command="debug:event-dispatcher" />
6565
</service>
6666

67-
<service id="Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand">
67+
<service id="console.command.router_debug" class="Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand">
6868
<argument type="service" id="router" />
6969
<tag name="console.command" command="debug:router" />
7070
</service>
7171

72-
<service id="Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand">
72+
<service id="console.command.router_match" class="Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand">
7373
<argument type="service" id="router" />
7474
<tag name="console.command" command="router:match" />
7575
</service>
7676

77-
<service id="Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand">
77+
<service id="console.command.translation_debug" class="Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand">
7878
<argument type="service" id="translator" />
7979
<argument type="service" id="translation.reader" />
8080
<argument type="service" id="translation.extractor" />
8181
<tag name="console.command" command="debug:translation" />
8282
</service>
8383

84-
<service id="Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand">
84+
<service id="console.command.translation_update" class="Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand">
8585
<argument type="service" id="translation.writer" />
8686
<argument type="service" id="translation.reader" />
8787
<argument type="service" id="translation.extractor" />
8888
<argument>%kernel.default_locale%</argument>
8989
<tag name="console.command" command="translation:update" />
9090
</service>
9191

92-
<service id="Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand">
92+
<service id="console.command.workflow_dump" class="Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand">
9393
<tag name="console.command" command="workflow:dump" />
9494
</service>
9595

96-
<service id="Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand">
96+
<service id="console.command.xliff_lint" class="Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand">
9797
<tag name="console.command" command="lint:xliff" />
9898
</service>
9999

100-
<service id="Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand">
100+
<service id="console.command.yaml_lint" class="Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand">
101101
<tag name="console.command" command="lint:yaml" />
102102
</service>
103103

104-
<service id="Symfony\Component\Form\Command\DebugCommand">
104+
<service id="console.command.form_debug" class="Symfony\Component\Form\Command\DebugCommand">
105105
<argument type="service" id="form.registry" />
106106
<argument type="collection" /> <!-- All form types namespaces are stored here by FormPass -->
107107
<argument type="collection" /> <!-- All services form types are stored here by FormPass -->

src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@
6868
<argument type="tagged" tag="config_cache.resource_checker" />
6969
</service>
7070

71-
<service id="Symfony\Component\DependencyInjection\Config\ContainerParametersResourceChecker">
71+
<service id="dependency_injection.config.container_parameters_resource_checker" class="Symfony\Component\DependencyInjection\Config\ContainerParametersResourceChecker">
7272
<argument type="service" id="service_container" />
7373
<tag name="config_cache.resource_checker" priority="-980" />
7474
</service>
7575

76-
<service id="Symfony\Component\Config\Resource\SelfCheckingResourceChecker">
76+
<service id="config.resource.self_checking_resource_checker" class="Symfony\Component\Config\Resource\SelfCheckingResourceChecker">
7777
<tag name="config_cache.resource_checker" priority="-990" />
7878
</service>
7979

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
1313

1414
use Doctrine\Common\Annotations\Annotation;
15-
use Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand;
1615
use Symfony\Bundle\FullStack;
1716
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1817
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddAnnotationsCachedReaderPass;
@@ -314,7 +313,7 @@ public function testWorkflowServicesCanBeEnabled()
314313
$container = $this->createContainerFromFile('workflows_enabled');
315314

316315
$this->assertTrue($container->has(Registry::class));
317-
$this->assertTrue($container->hasDefinition(WorkflowDumpCommand::class));
316+
$this->assertTrue($container->hasDefinition('console.command.workflow_dump'));
318317
}
319318

320319
public function testRouter()

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Bundle\SecurityBundle\Command\InitAclCommand;
1515
use Symfony\Bundle\SecurityBundle\Command\SetAclCommand;
16-
use Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand;
1716
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
1817
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
1918
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
@@ -122,7 +121,7 @@ public function load(array $configs, ContainerBuilder $container)
122121

123122
if (class_exists(Application::class)) {
124123
$loader->load('console.xml');
125-
$container->getDefinition(UserPasswordEncoderCommand::class)->replaceArgument(1, array_keys($config['encoders']));
124+
$container->getDefinition('security.command.user_password_encoder')->replaceArgument(1, array_keys($config['encoders']));
126125
}
127126

128127
// load ACL

src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<tag name="console.command" command="acl:set" />
1919
</service>
2020

21-
<service id="Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand">
21+
<service id="security.command.user_password_encoder" class="Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand">
2222
<argument type="service" id="security.encoder_factory"/>
2323
<argument type="collection" /> <!-- encoders' user classes -->
2424
<tag name="console.command" command="security:encode-password" />

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\Reference;
1817
use Symfony\Bundle\SecurityBundle\SecurityBundle;
@@ -521,7 +520,7 @@ public function testUserCheckerConfigWithNoCheckers()
521520

522521
public function testUserPasswordEncoderCommandIsRegistered()
523522
{
524-
$this->assertTrue($this->getContainer('remember_me_options')->has(UserPasswordEncoderCommand::class));
523+
$this->assertTrue($this->getContainer('remember_me_options')->has('security.command.user_password_encoder'));
525524
}
526525

527526
public function testDefaultAccessDecisionManagerStrategyIsAffirmative()

src/Symfony/Bundle/TwigBundle/Resources/config/console.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<services>
88
<defaults public="false" />
99

10-
<service id="Symfony\Bridge\Twig\Command\DebugCommand">
10+
<service id="twig.command.debug" class="Symfony\Bridge\Twig\Command\DebugCommand">
1111
<argument type="service" id="twig" />
1212
<argument>%kernel.project_dir%</argument>
1313
<tag name="console.command" command="debug:twig" />
1414
</service>
1515

16-
<service id="Symfony\Bundle\TwigBundle\Command\LintCommand">
16+
<service id="twig.command.lint" class="Symfony\Bundle\TwigBundle\Command\LintCommand">
1717
<argument type="service" id="twig" />
1818
<tag name="console.command" command="lint:twig" />
1919
</service>

0 commit comments

Comments
 (0)