Skip to content

Commit 30a67ea

Browse files
committed
Fix too eager deprecations for PhpAstExtractor
1 parent fc0f8da commit 30a67ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,8 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13061306
$container->removeDefinition('translation.locale_switcher');
13071307
}
13081308

1309-
if (ContainerBuilder::willBeAvailable('nikic/php-parser', Parser::class, ['symfony/translation'])
1310-
&& ContainerBuilder::willBeAvailable('symfony/translation', PhpAstExtractor::class, ['symfony/framework-bundle'])
1311-
) {
1309+
// don't use ContainerBuilder::willBeAvailable() as these are not needed in production
1310+
if (interface_exists(Parser::class) && class_exists(PhpAstExtractor::class)) {
13121311
$container->removeDefinition('translation.extractor.php');
13131312
} else {
13141313
$container->removeDefinition('translation.extractor.php_ast');

src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
->tag('translation.dumper', ['alias' => 'res'])
154154

155155
->set('translation.extractor.php', PhpExtractor::class)
156+
->deprecate('symfony/framework-bundle', '6.2', 'The "%service_id%" service is deprecated, use "translation.extractor.php_ast" instead.')
156157
->tag('translation.extractor', ['alias' => 'php'])
157158

158159
->set('translation.extractor.php_ast', PhpAstExtractor::class)

0 commit comments

Comments
 (0)