Magento already provides the useful command dev:di:info for inspecting dependency injection. However, it does not display an entire plugin chain for a particular method. A small custom CLI command can retrieve that information directly from Magento’s interception configuration.

The following command is therefore not a standard Magento command, but is implemented in the example below:

First, register the command in etc/di.xml registered by your own module:

The command class then accesses Magento’s PluginListInterface zu:

After installing the command, you can inspect the plugin chain for ProductRepositoryInterface::save() ausgeben:

You can also inspect the Magento admin area:

The output becomes particularly interesting when several extensions modify the same method. In particular, around Plugins can control execution: by calling or not calling the next callable, a plugin determines whether the rest of the chain and the original method are reached.

This makes it possible to understand which plugins Magento actually invokes, and in which order, for a given method..

Displaying the Plugin Chain of a Method via CLI
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: