LexikTranslationBundle icon indicating copy to clipboard operation
LexikTranslationBundle copied to clipboard

Fix deprecation warning

Open knallcharge opened this issue 2 years ago • 5 comments

removes deprecation warning to prepare for compatibility with symfony 6

knallcharge avatar Jan 04 '22 08:01 knallcharge

@Knallcharge with which version does the deprecation warning occur?

bartmcleod avatar Jan 31 '22 19:01 bartmcleod

@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.

knallcharge avatar Feb 01 '22 06:02 knallcharge

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

bartmcleod avatar Feb 01 '22 08:02 bartmcleod

@bartmcleod Symfony 5.4.4

knallcharge avatar Feb 01 '22 09:02 knallcharge

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.

raziel057 avatar Mar 09 '22 11:03 raziel057

@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 avatar Nov 27 '22 19:11 bartmcleod

@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

bartmcleod avatar Nov 30 '22 09:11 bartmcleod