Hello. I use the autowiring of Symfony, so I don't need to manage service dependencies.
Autowiring allows you to manage services in the container with minimal configuration. It reads the type-hints on your constructor (or other methods) and automatically passes the correct services to each method.
To enable it, make sure that your config/services.yaml file configuration is like that:
services:# default configuration for services in *this* file_defaults:autowire:true# Automatically injects dependencies in your services.autoconfigure:true# Automatically registers your services as commands, event subscribers, etc.App\:resource:'../src/'exclude:-'../src/DependencyInjection/'-'../src/Entity/'-'../src/Kernel.php'-'../src/Tests/'
Hello. I use the autowiring of Symfony, so I don't need to manage service dependencies.
To enable it, make sure that your
config/services.yaml
file configuration is like that:Of course !
How did I not think about that before ?
Been doing symfony for 4 years now and still forgetting basics lol .
Thx for the help. Much appreciated !