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