Skip to main content

Adobe Commerce

How to Check for Dependency Injection Information in Magento 2

A team of developers working on various projects

Whenever I use Magento to troubleshoot a project-specific problem, I discover a cool functionality that I was unaware of. This time, use “bin/magento dev:di:info” with Magento!

If you supply a class as a string to this command, you will receive:

  • The preferred class of this class or interface, or the preference.
  • The parameters this preference receives, together with the required values and types for each
  • Plugins that connect to this interface
  • Any plugins for this interface’s relevant preference

ex: bin/magento dev:di:info “Magento\Catalog\Model\Category”

Outnew

When attempting to figure out what is going on with all of the dependency injection information preferences set throughout your Magento store, this can be VERY helpful. Particularly when you are attempting to grasp Magento or have a truly challenging troubleshooting circumstance.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sachin Badase

An expert in his own right, Sachin is exceptional in his drive to thrill clients and coach his fellow colleagues, all of which impact those around him. His technical leadership and desire to help team members grow are admirable. Sachin is always willing to provide advice and support others when issues arise. He goes out of his way to share his deep technical knowledge as a mentor to new colleagues, helping them transition smoothly into their new roles.

More from this Author

Categories
Follow Us
TwitterLinkedinFacebookYoutubeInstagram