magento-di
Installation
SKILL.md
Magento 2 Dependency Injection
Before writing code
Fetch live docs:
- Web-search
site:developer.adobe.com commerce php development components dependency-injectionfor the DI guide - Fetch
https://developer.adobe.com/commerce/php/development/and navigate to DI documentation - Web-search
site:developer.adobe.com commerce php development build di-xmlfor di.xml reference
Conceptual Architecture
How DI Works in Magento
Magento's Object Manager reads di.xml configurations and automatically injects dependencies into class constructors. You declare what you need; the framework provides it.
Constructor injection is the primary pattern — declare dependencies as constructor parameters with type hints.