@@ -143,7 +143,7 @@ public function build(ContainerBuilder $container)
143143 $ container ->addCompilerPass (new RegisterControllerArgumentLocatorsPass ());
144144 $ container ->addCompilerPass (new RemoveEmptyControllerArgumentLocatorsPass (), PassConfig::TYPE_BEFORE_REMOVING );
145145 $ container ->addCompilerPass (new RoutingResolverPass ());
146- $ container -> addCompilerPass ( new DataCollectorTranslatorPass () );
146+ $ this -> addCompilerPassIfExists ( $ container , DataCollectorTranslatorPass::class );
147147 $ container ->addCompilerPass (new ProfilerPass ());
148148 // must be registered before removing private services as some might be listeners/subscribers
149149 // but as late as possible to get resolved parameters
@@ -156,7 +156,7 @@ public function build(ContainerBuilder $container)
156156 // twig.template_iterator definition
157157 $ this ->addCompilerPassIfExists ($ container , TranslatorPass::class, PassConfig::TYPE_BEFORE_OPTIMIZATION , -32 );
158158 $ this ->addCompilerPassIfExists ($ container , TranslatorPathsPass::class, PassConfig::TYPE_AFTER_REMOVING );
159- $ container -> addCompilerPass ( new LoggingTranslatorPass () );
159+ $ this -> addCompilerPassIfExists ( $ container , LoggingTranslatorPass::class );
160160 $ container ->addCompilerPass (new AddExpressionLanguageProvidersPass ());
161161 $ this ->addCompilerPassIfExists ($ container , TranslationExtractorPass::class);
162162 $ this ->addCompilerPassIfExists ($ container , TranslationDumperPass::class);
0 commit comments