Mastering Symfony 4's Dependency Injection
summary
Explains how Symfony 4 hides the container and relies on automation to compile service definitions into PHP classes, then demonstrates by building a skeleton app and a Greeter service used via constructor and action injection. Shows how services.yaml uses autowire, autoconfigure, resource, bindings, env var processors and named autowiring aliases (example: multiple cache pools injected by argument name). Opens the compiled container to show generated factory methods, notes performance win from splitting container files, and proposes generating a preloading PHP file for hot-path services.
AI-written summary · about
chapters (20)
- 0:00Intro
- 3:40What is Symphony 4
- 4:27Dependency Injection
- 6:11Creating a Symphony application
- 8:00Flex
- 10:40Skeleton
- 11:50Status
- 12:57Containers
- 14:45Compiler Passes
- 17:38Container Files
- 21:00Compiled Container
- 26:54Preloading
- 34:35Greater class
- 41:52Inline roots parameter configuration
- 44:02Open compiled files
- 44:56Constructor vs Action Injection
- 47:15Class
- 48:45Design Issue
- 53:30AutoWiring
- 55:55Service Configuration
related talks
49m"Deep Dive into Symfony's Dependency Injection Component"
02h 37mSymfony 4 best practices (Part 2)
34mGetting the most out of Symfony4
40mDeep dive into Symfony 4 internals
34mSymfony 4: A new Way to develop Applications
02h 27mSymfony 4 best practices (Part 1)
01h 01mDeep dive into Symfony 4 internals
28mA dive into Symfony4 for a Symfony user
