lexik / LexikTranslationBundle

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

Fix SF63 deprecations - annotations to attributes #438

Closed raziel057 closed 1 year ago

raziel057 commented 1 year ago

SF6.3 raised the following deprecation that we can fix replacing the @required annotation by #[Required] (Symfony\Contracts\Service\Attribute\Required) attribute n top of setRequestStack and setTokenManager methods in https://github.com/lexik/LexikTranslationBundle/blob/master/Util/Csrf/CsrfCheckerTrait.php

The compatibility with lower versions should be right as the class exists since SF5.2 and this package is constraint to Symfony ~6.0 and require PHP >= 8.1. See https://symfony.com/blog/new-in-symfony-5-2-php-8-attributes

1x: Since symfony/dependency-injection 6.3: Relying on the "@required" annotation on method "Lexik\Bundle\TranslationBundle\Controller\RestController::setRequestStack()" is deprecated, use the "Symfony\Contracts\Service\Attribute\Required" attribute instead.
1x in DelegationControllerTest::quotaIncreaseProvideData from PTC\AdminBundle\Tests\Controller

1x: Since symfony/dependency-injection 6.3: Relying on the "@required" annotation on method "Lexik\Bundle\TranslationBundle\Controller\RestController::setTokenManager()" is deprecated, use the "Symfony\Contracts\Service\Attribute\Required" attribute instead.
1x in DelegationControllerTest::quotaIncreaseProvideData from PTC\AdminBundle\Tests\Controller

1x: Since symfony/dependency-injection 6.3: Relying on the "@required" annotation on method "Lexik\Bundle\TranslationBundle\Controller\TranslationController::setRequestStack()" is deprecated, use the "Symfony\Contracts\Service\Attribute\Required" attribute instead.
1x in DelegationControllerTest::quotaIncreaseProvideData from PTC\AdminBundle\Tests\Controller

1x: Since symfony/dependency-injection 6.3: Relying on the "@required" annotation on method "Lexik\Bundle\TranslationBundle\Controller\TranslationController::setTokenManager()" is deprecated, use the "Symfony\Contracts\Service\Attribute\Required" attribute instead.
1x in DelegationControllerTest::quotaIncreaseProvideData from PTC\AdminBundle\Tests\Controller

Fix https://github.com/lexik/LexikTranslationBundle/issues/437