9
votes

Symfony Version: 4.1

I have the following deprecation message when I run my tests with PHPUnit:

The annotation "Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route" is deprecated since version 5.2. Use "Symfony \ Component \ Routing \ Annotation \ Route" instead.

I want to clarify that I put in my framework.yaml:

sensio_framework_extra:
     router:
         annotations: false

I also want to clarify that I have no use Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route in my controllers.

I use FOSRestBundle and I get the impression that the problem comes from there, but I tried to fix the configuration provided in the FOSREST documentation.

Have you had this type of error and / or do you know where I should look?

4

4 Answers

8
votes

Actually it's not an error, but deprecation notice. Check for "sensio/framework-extra-bundle" in composer.json, it might be there.

But to remove deprecation message add the following lines to your config.yml file

sensio_framework_extra:
 router:
     annotations: false

See attached image.

enter image description here

4
votes

Sensio\Bundle\FrameworkExtraBundle\Configuration\Route is deprecated.

Use Symfony\Component\Routing\Annotation\Route

1
votes

The setting does not disable the warning, why would it?

You are still using the annotation, you should be aware. The trigger_error is unconditional, see: https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/master/Configuration/Route.php#L16

I would not worry too much about it. FOS REST will catch up.

1
votes

Remove totaly the framework composer remove sensio/framework-extra-bundle dont fogret to delete the instance requirement from appKernel.php