-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] removed the Translation component dependency on FrameworkBundle #20070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pendency on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Translation component dependency on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/translation explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Translation component from the list. Commits ------- a496a2a [FrameworkBundle] removed the Translation component dependency on FrameworkBundle
@@ -87,6 +87,18 @@ protected function configure() | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function isEnabled() | |||
{ | |||
if (!class_exists('Symfony\Component\Translation\Translator')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use ::class
notation here
@@ -85,8 +85,10 @@ public function build(ContainerBuilder $container) | |||
$container->addCompilerPass(new AddCacheWarmerPass()); | |||
$container->addCompilerPass(new AddCacheClearerPass()); | |||
$container->addCompilerPass(new AddExpressionLanguageProvidersPass()); | |||
$container->addCompilerPass(new TranslationExtractorPass()); | |||
$container->addCompilerPass(new TranslationDumperPass()); | |||
if (class_exists('Symfony\Component\Translation\Translator')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all other compiler passes are always registered, and return early when the service does not exist (accounting for disabling by configuration too). Shouldn't it be done here too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for those as well. It was more about not even registering them if the translation component is not installed. But that's probably not really needed as this is for build only. I'm going to revert this change.
Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Translation component from the list.