@@ -21,8 +21,10 @@ class TranslatorPass implements CompilerPassInterface
21
21
private $ translatorServiceId ;
22
22
private $ readerServiceId ;
23
23
private $ loaderTag ;
24
+ private $ debugCommandServiceId ;
25
+ private $ updateCommandServiceId ;
24
26
25
- public function __construct ($ translatorServiceId = 'translator.default ' , $ readerServiceId = 'translation.loader ' , $ loaderTag = 'translation.loader ' )
27
+ public function __construct ($ translatorServiceId = 'translator.default ' , $ readerServiceId = 'translation.loader ' , $ loaderTag = 'translation.loader ' , $ debugCommandServiceId = ' console.command.translation_debug ' , $ updateCommandServiceId = ' console.command.translation_update ' )
26
28
{
27
29
if ('translation.loader ' === $ readerServiceId && 2 > func_num_args ()) {
28
30
@trigger_error ('The default value for $readerServiceId will change in 4.0 to "translation.reader". ' , E_USER_DEPRECATED );
@@ -31,6 +33,8 @@ public function __construct($translatorServiceId = 'translator.default', $reader
31
33
$ this ->translatorServiceId = $ translatorServiceId ;
32
34
$ this ->readerServiceId = $ readerServiceId ;
33
35
$ this ->loaderTag = $ loaderTag ;
36
+ $ this ->debugCommandServiceId = $ debugCommandServiceId ;
37
+ $ this ->updateCommandServiceId = $ updateCommandServiceId ;
34
38
}
35
39
36
40
public function process (ContainerBuilder $ container )
@@ -75,5 +79,10 @@ public function process(ContainerBuilder $container)
75
79
->replaceArgument (0 , ServiceLocatorTagPass::register ($ container , $ loaderRefs ))
76
80
->replaceArgument (3 , $ loaders )
77
81
;
82
+
83
+ if ($ container ->hasParameter ('twig.default_path ' )) {
84
+ $ container ->getDefinition ($ this ->debugCommandServiceId )->replaceArgument (4 , $ container ->getParameter ('twig.default_path ' ));
85
+ $ container ->getDefinition ($ this ->updateCommandServiceId )->replaceArgument (5 , $ container ->getParameter ('twig.default_path ' ));
86
+ }
78
87
}
79
88
}
0 commit comments