FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

Symfony 6.3 annotation issue

Open hual7 opened this issue 2 years ago • 3 comments

Q A
Symfony Version 6.3
Sulu Version 2.5.9
Related Issue https://github.com/sulu/SuluArticleBundle/issues/641

After upgrading to Symfony 6.3 console shows a semantical error

[Semantical Error] The annotation "@FOS\RestBundle\Controller\Annotations\Get" in method Sulu\Bundle\ArticleBundle\Controller\ArticleController::getAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /vendor/sulu/article-bundle/Resources/config/routing_api.yml (which is being imported from "/config/routes/sulu_admin.yaml"). Make sure there is a loader supporting the "rest" type.

[Semantical Error] The annotation "@FOS\RestBundle\Controller\Annotations\Get" in method Sulu\Bundle\ArticleBundle\Controller\ArticleController::getAction() was never imported. Did you maybe forget to add a "use" statement for this annotation?

hual7 avatar Jun 08 '23 08:06 hual7

Hi same for me in two places for Symfony 6.3: [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "FOS\RestBundle\FOSRestBundle" now to avoid errors or add an explicit @return annotation to suppress this message.

PHP Deprecated: Since symfony/serializer 6.3: Not implementing the "NormalizerInterface::getSupportedTypes()" in "FOS\RestBundle\Serializer\Normalizer\FormErrorNormalizer" is deprecated. in /app/vendor/symfony/deprecation-contracts/function.php on line 25

@mbabker can you help?

vsko-dev avatar Aug 03 '23 14:08 vsko-dev

Neither of those deprecations are related to this annotations issue.

But, for the serializer one, https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2388 seems like it would address it.

mbabker avatar Aug 03 '23 14:08 mbabker

I will love getting this merged. I this the only few SF 6.3 deprecations warnings that I have in several projects since ApiPlataform already update this same problem too.

shakaran avatar Aug 04 '23 16:08 shakaran

@goetas I think that it is safe close this issue since already merged. Thanks

shakaran avatar Mar 13 '24 20:03 shakaran