Symfony moved into version 4 last November. One of the best patterns embraced by the newest major version of this venerable framework is Autowiring — basically a term for Dependency Injection that uses PHP type-hinting.
What is Dependency Injection?
A fine place to start!
To summarize Dependency Injection as simply as possible: When a class needs another class, the framework should provide it. The developer only needs to handle the configuration and code of those classes.
These classes are called “Services.” In Symfony, when you want to make some code available for use by other classes, you put it in a Service. Symfony makes it easy to provide these Services to the rest of your application. …