You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$translatorinstanceof LegacyTranslatorInterface && !$translatorinstanceof TranslatorInterface) {
60
62
thrownew \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
@@ -66,6 +68,8 @@ public function __construct($translator, TranslationReaderInterface $reader, Ext
66
68
$this->extractor = $extractor;
67
69
$this->defaultTransPath = $defaultTransPath;
68
70
$this->defaultViewsPath = $defaultViewsPath;
71
+
$this->transPaths = $transPaths;
72
+
$this->viewsPaths = $viewsPaths;
69
73
}
70
74
71
75
/**
@@ -131,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($dir = $rootDir.'/Resources/translations')) {
136
140
if ($dir !== $this->defaultTransPath) {
137
141
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
@@ -142,7 +146,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
142
146
if ($this->defaultTransPath) {
143
147
$transPaths[] = $this->defaultTransPath;
144
148
}
145
-
$viewsPaths = array();
149
+
$viewsPaths = $this->viewsPaths;
146
150
if (is_dir($dir = $rootDir.'/Resources/views')) {
147
151
if ($dir !== $this->defaultViewsPath) {
148
152
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
@@ -165,7 +169,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
165
169
if (is_dir($dir = sprintf('%s/Resources/%s/translations', $rootDir, $bundle->getName()))) {
166
170
$transPaths[] = $dir;
167
171
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $dir, $bundle->getName());
168
-
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : sprintf('configure and use "framework.translator.default_path" instead.', $bundle->getName())), E_USER_DEPRECATED);
172
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('use the "%s" directory instead.', $this->defaultTransPath) : 'configure and use "framework.translator.default_path" instead.'), E_USER_DEPRECATED);
@@ -174,7 +178,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
174
178
if (is_dir($dir = sprintf('%s/Resources/%s/views', $rootDir, $bundle->getName()))) {
175
179
$viewsPaths[] = $dir;
176
180
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $bundle->getName(), $dir);
177
-
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : sprintf('configure and use "twig.default_path" instead.', $bundle->getName())), E_USER_DEPRECATED);
181
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : 'configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
178
182
}
179
183
} catch (\InvalidArgumentException$e) {
180
184
// such a bundle does not exist, so treat the argument as path
@@ -212,7 +216,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
212
216
if (is_dir($deprecatedPath = sprintf('%s/Resources/%s/views', $rootDir, $bundle->getName()))) {
213
217
$viewsPaths[] = $deprecatedPath;
214
218
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $bundle->getName(), $deprecatedPath);
215
-
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : sprintf('configure and use "twig.default_path" instead.', $bundle->getName())), E_USER_DEPRECATED);
219
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : 'configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
if (is_dir($dir = $rootDir.'/Resources/translations')) {
126
130
if ($dir !== $this->defaultTransPath) {
127
131
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
@@ -132,7 +136,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
132
136
if ($this->defaultTransPath) {
133
137
$transPaths[] = $this->defaultTransPath;
134
138
}
135
-
$viewsPaths = array();
139
+
$viewsPaths = $this->viewsPaths;
136
140
if (is_dir($dir = $rootDir.'/Resources/views')) {
137
141
if ($dir !== $this->defaultViewsPath) {
138
142
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2, ', $dir);
@@ -165,7 +169,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
165
169
if (is_dir($dir = sprintf('%s/Resources/%s/views', $rootDir, $foundBundle->getName()))) {
166
170
$viewsPaths[] = $dir;
167
171
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2, ', $foundBundle->getName(), $dir);
168
-
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : sprintf('configure and use "twig.default_path" instead.', $foundBundle->getName())), E_USER_DEPRECATED);
172
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('use the "%s" directory instead.', $this->defaultViewsPath) : 'configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
169
173
}
170
174
$currentName = $foundBundle->getName();
171
175
} catch (\InvalidArgumentException$e) {
@@ -261,7 +265,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
261
265
$extractedMessagesCount += $domainMessagesCount;
262
266
}
263
267
264
-
if ('xlf' == $input->getOption('output-format')) {
268
+
if ('xlf' ===$input->getOption('output-format')) {
265
269
$errorIo->comment('Xliff output version is <info>1.2</info>');
0 commit comments