@@ -143,7 +143,7 @@ public function build(ContainerBuilder $container)
143
143
$ container ->addCompilerPass (new RegisterControllerArgumentLocatorsPass ());
144
144
$ container ->addCompilerPass (new RemoveEmptyControllerArgumentLocatorsPass (), PassConfig::TYPE_BEFORE_REMOVING );
145
145
$ container ->addCompilerPass (new RoutingResolverPass ());
146
- $ container -> addCompilerPass ( new DataCollectorTranslatorPass () );
146
+ $ this -> addCompilerPassIfExists ( $ container , DataCollectorTranslatorPass::class );
147
147
$ container ->addCompilerPass (new ProfilerPass ());
148
148
// must be registered before removing private services as some might be listeners/subscribers
149
149
// but as late as possible to get resolved parameters
@@ -156,7 +156,7 @@ public function build(ContainerBuilder $container)
156
156
// twig.template_iterator definition
157
157
$ this ->addCompilerPassIfExists ($ container , TranslatorPass::class, PassConfig::TYPE_BEFORE_OPTIMIZATION , -32 );
158
158
$ this ->addCompilerPassIfExists ($ container , TranslatorPathsPass::class, PassConfig::TYPE_AFTER_REMOVING );
159
- $ container -> addCompilerPass ( new LoggingTranslatorPass () );
159
+ $ this -> addCompilerPassIfExists ( $ container , LoggingTranslatorPass::class );
160
160
$ container ->addCompilerPass (new AddExpressionLanguageProvidersPass ());
161
161
$ this ->addCompilerPassIfExists ($ container , TranslationExtractorPass::class);
162
162
$ this ->addCompilerPassIfExists ($ container , TranslationDumperPass::class);
0 commit comments