From 3c0372bfb2e85d5ad7db3be20e8c92268e6bca73 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko Date: Sun, 1 Jul 2018 18:19:20 +0300 Subject: [PATCH 1/2] [FIX] dev:di:info duplicates plugin info --- app/code/Magento/Developer/Model/Di/PluginList.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Developer/Model/Di/PluginList.php b/app/code/Magento/Developer/Model/Di/PluginList.php index 0a1df8a974242..39b978ac6fd93 100644 --- a/app/code/Magento/Developer/Model/Di/PluginList.php +++ b/app/code/Magento/Developer/Model/Di/PluginList.php @@ -143,9 +143,8 @@ private function addPluginToList($pluginInstance, $pluginMethod, $methodTypes, $ { if ($methodTypes & $typeCode) { if (!array_key_exists($pluginInstance, $this->pluginList[$this->pluginTypeMapping[$typeCode]])) { - $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance] = []; + $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance][] = $pluginMethod; } - $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance][] = $pluginMethod ; } } } From 3f70b119ac32e109eac852b82bfe2339a0367b84 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko Date: Tue, 3 Jul 2018 20:55:06 +0300 Subject: [PATCH 2/2] Fix according review - change how we manage that plugin in a property array --- app/code/Magento/Developer/Model/Di/PluginList.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Developer/Model/Di/PluginList.php b/app/code/Magento/Developer/Model/Di/PluginList.php index 39b978ac6fd93..fc342b5051000 100644 --- a/app/code/Magento/Developer/Model/Di/PluginList.php +++ b/app/code/Magento/Developer/Model/Di/PluginList.php @@ -143,6 +143,10 @@ private function addPluginToList($pluginInstance, $pluginMethod, $methodTypes, $ { if ($methodTypes & $typeCode) { if (!array_key_exists($pluginInstance, $this->pluginList[$this->pluginTypeMapping[$typeCode]])) { + $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance] = []; + } + + if (!in_array($pluginMethod, $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance])) { $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance][] = $pluginMethod; } }