LocaleBundle icon indicating copy to clipboard operation
LocaleBundle copied to clipboard

Symfony 4 compatibility: Service visibility deprecation

Open thanosp opened this issue 8 years ago • 3 comments

User Deprecated: The "lunetics_locale.allowed_locales_provider" service is private, 
getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. 
You should either make the service public, or stop using the container directly
and use dependency injection instead.

User Deprecated: The "lunetics_locale.switcher_helper" service is private, 
getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. 
You should either make the service public, or stop using the container directly
 and use dependency injection instead.

Just updated to 3.4 and noticed these deprecations amongst others of ours. I find it a bit weird that the tests are passing for symfony 4 for this bundle but haven't tried the combination yet myself. Am I missing something? The related code/configuration seems unchanged.

thanosp avatar Dec 05 '17 15:12 thanosp

maybe the tests are lacking. are you sure you do not access this services with a $container->get() yourself? if its in this bundle, we should fix it to DI instead.

dbu avatar Dec 05 '17 15:12 dbu

There are no mentions of these services in our codebase.

Maybe from here and here

thanosp avatar Dec 05 '17 22:12 thanosp

ups. can you try to rewrite that to inject the services and parameters in the constructor, instead of pulling them from the container?

dbu avatar Dec 06 '17 07:12 dbu