Skip to content

Commit 4292cc0

Browse files
minor #52190 [FrameworkBundle] Fix requiring moved translation compiler passes (fancyweb)
This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle] Fix requiring moved translation compiler passes | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #52032 (comment) | License | MIT Those 2 also need to be required conditionally since symfony/translation is not a hard dependency of FWB. Commits ------- 2b95681 [FrameworkBundle] Fix requiring moved translation compiler passes
2 parents 124706b + 2b95681 commit 4292cc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function build(ContainerBuilder $container)
144144
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
145145
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);
146146
$container->addCompilerPass(new RoutingResolverPass());
147-
$container->addCompilerPass(new DataCollectorTranslatorPass());
147+
$this->addCompilerPassIfExists($container, DataCollectorTranslatorPass::class);
148148
$container->addCompilerPass(new ProfilerPass());
149149
// must be registered before removing private services as some might be listeners/subscribers
150150
// but as late as possible to get resolved parameters
@@ -157,7 +157,7 @@ public function build(ContainerBuilder $container)
157157
// twig.template_iterator definition
158158
$this->addCompilerPassIfExists($container, TranslatorPass::class, PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
159159
$this->addCompilerPassIfExists($container, TranslatorPathsPass::class, PassConfig::TYPE_AFTER_REMOVING);
160-
$container->addCompilerPass(new LoggingTranslatorPass());
160+
$this->addCompilerPassIfExists($container, LoggingTranslatorPass::class);
161161
$container->addCompilerPass(new AddExpressionLanguageProvidersPass());
162162
$this->addCompilerPassIfExists($container, TranslationExtractorPass::class);
163163
$this->addCompilerPassIfExists($container, TranslationDumperPass::class);

0 commit comments

Comments
 (0)