PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 15, 2022

[FIXED] Deprecation on a service: Symfony asks to change service name

 January 15, 2022     php, symfony, symfony-3.4, symfony-4.3     No comments   

Issue

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.


Solution

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.



Answered By - Caconde
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing