lexik / LexikTranslationBundle

This Symfony bundle allow to import translation files content into the database and provide a GUI to edit translations.
MIT License
419 stars 255 forks source link

Fix deprecation warning #409

Closed knallcharge closed 1 year ago

knallcharge commented 2 years ago

removes deprecation warning to prepare for compatibility with symfony 6

bartmcleod commented 2 years ago

@Knallcharge with which version does the deprecation warning occur?

knallcharge commented 2 years ago

@bartmcleod I'm on dev-master 679a835, but I'm still getting the error, Actually there's another one that I didn't notice before: 1. Method "Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder()" might add "TreeBuilder" as a native return type declaration in the future. Do the same in implementation "Lexik\Bundle\TranslationBundle\DependencyInjection\Configuration" now to avoid errors or add an explicit @return annotation to suppress this message. 2. User Deprecated: Method "Symfony\Component\Config\Resource\SelfCheckingResourceInterface::isFresh()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Lexik\Bundle\TranslationBundle\Translation\DatabaseFreshResource" now to avoid errors or add an explicit @return annotation to suppress this message.

bartmcleod commented 2 years ago

@Knallcharge ah, I should have asked a more specific question: which version of Symfony did you have when you saw the warnings?

knallcharge commented 2 years ago

@bartmcleod Symfony 5.4.4

raziel057 commented 2 years ago

It would be preferable to add the return type public function getConfigTreeBuilder(): TreeBuilder (not as comment) as the bundle target PHP 7.4 as minimal version.

bartmcleod commented 1 year ago

@Knallcharge I agree with @raziel057 Also, I think we should maybe fix this in automatically for version 5.4, using Rector for example, then have a 5.4 branch and then move master forward to support PHP 8 and SF 6 only

bartmcleod commented 1 year ago

@Knallcharge @raziel057 I am closing this, because master now has all php 8.1 features. If you stil want this for 5.4, we can create a 5.4 branch off the 5.3 branch and apply it there. Since you intended this to prepare for SF 6, I think you will be happy with master as it is, because it runs just fine with SF 6 on php 8.1