Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
The The
First, autowiring applies to configuring the services in your DI container. It's not a runtime behavior, and Symfony can't overload the PHP Second, not everything can be autowired for one reason or another, or there might be an ambiguity when using autowiring and you'd need an extra bit of information to resolve that ambiguity. Using the example right in the |
Beta Was this translation helpful? Give feedback.
-
If I understand correctly, both show services.
bin/console debug:container
should show all available services and I suppose thatbin/console debug:autowiring
only shows the ones that we can inject as parameters into our methods (controllers in particular). Is this correct? If that's correct, then why aren't all services autowiring, i.e. why are there services which we can't simply inject and thus, I suppose, we need to manually create withnew
?Beta Was this translation helpful? Give feedback.
All reactions