0

I am currently trying for the first time to migrate from Symfony 3.4 to 4.3.

I'm at the stage where I have to remove the depreciation so that I can update the dependencies via composing as the doc says

I have solved all the deprecations except one that I have a little trouble. Here it is:

Relying on service auto-registration for type "AppBundle\Entity\AdaImporterDoc" is deprecated since Symfony 3.4 and won't be supported in 4.0. Create a service named "AppBundle\Entity\AdaImporterDoc" instead.

Jboucly
  • 720
  • 6
  • 17

1 Answers1

1

This is not a rare situation when upgrading to Symfony 4.

To avoid that deprecation warning message that is, in fact, a false positive (Read This), you can replicate the way Symfony 4 works, doing the following in your app/config/config.yml:

parameters:
    container.autowiring.strict_mode: true

This way that 'fake' warning message will disappear and you will get real errors, if found.

If you want to know what changed on autowiring, this Strict Autowiring Mode is good place to start.

Caconde
  • 4,177
  • 7
  • 35
  • 32
  • This didn't work for me for some reason. I'm trying to upgrade a Symfony 3.4 app to 4 and going through deprecation warnings... our Sonata config file also contains a a bunch services definition trying to pass in Entity class paths to bubble up to AbstractAdmin, and I get the warning... I'm seeing zero solution for this yet. Symfony/Sonata's documentation doesn't even mention autowiring Entities, and I don't want to make them services, and I'm not seeing how to pass them. It's super-weird. – SteveExdia Jul 20 '22 at 23:10