Autowire all the things!
summary
Shows how a Symfony 2 legacy app with >1000 services (Nuvola) was migrated to autowire and autoconfigure, cutting about 5,500 lines of YAML. The migration is done in four steps: enable autowire per-file, add a legacy-alias file that declares public=true and class-name aliases, run container compilation to find and fix injection problems (entity managers, multiple implementations, setter injection, tagged/listener services), then enable service discovery and remove redundant service entries, resulting in a hybrid but working codebase.
AI-written summary · about
chapters (20)
- 0:00Welcome to Autowire talk
- 0:22Introduction
- 1:04Autowire definition
- 3:58Service Discovery vs Autowire
- 5:01Private services
- 6:25Scalar arguments
- 7:07Autowire recap
- 7:30Legacy app migration
- 8:13Enable Autowire first
- 8:55Define FQCN
- 9:57Configure services
- 10:42Full Service Discovery
- 11:48Validate container
- 13:13Autowire errors
- 15:18Setter injection
- 16:22Listener handling
- 17:05False attribute sharing
- 17:47Remove redundant services
- 18:32Summary
- 19:15Conclusion
related talks
02h 23mMastering Symfony 4's Dependency Injection
49m"Deep Dive into Symfony's Dependency Injection Component"
57mEating spaghetti with Symfony
17mSymfony Without Bundles
52mRefactoring to Symfony Components
37mOverriding Symfony in a million ways
34mSymfony 4: A new Way to develop Applications
01h 02mRewriting 12-Year-Old Code
