One common request over on my patreon slack is helping folks reason about some piece of functionality as-implemented in the Magento 2 core. This usually means looking for a particular dependency on a class, and then looking for that class’s dependency, and following this dependency chain back until we find the actual five lines of code we’re interested in.
Magento’s automatic constructor dependency injection means you can never be sure what dependencies the system is actually injecting, so these help sessions usually mean going on a grep
safari through Magento’s di.xml
files.
This is a common enough thing that this weekend I dusted off some shell scripts and pulled them together into a new website
This dependency injection reference will let you statically search through the hundreds of di.xml
files across Magento versions looking for any reference to a particular type/symbol. For example, here’s every configured dependency for the Magento\Catalog\Model\Product
class.
This is a soft launch — I might have more to say about this website later. If you’re still in the business of writing backend code for Magento 2 give things a look over. If you see areas where information needs to be corrected or features you like, let me know. This is my first Node.js backed website I’ve launched via Glitch.com so if something seems technically wrong it’s almost certainly me, not you.