-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions (*)
One of Magento Architects contacted me in private message blaming me for introducing Plugin to the Core that is not allowed in Magento and couldn't have been done by Magento Employees due to Quality Standards.
namespace Magento\Framework\App\Action\Plugin; | |
use Magento\Framework\Message\MessageInterface; | |
class Design |
lol.
As I've introduced another 2 plugins and renamed existing one to follow the naming convention, there are 3 plugins in the \Magento\Framework
namespace. As the architect wasn't so nice to tell me where outside \Magento\Framework` I should put these plugins, I create issue to satisfy "Quality Standards" of Magento.
The plugins to be moved:
https://github.com/magento/magento2/tree/2.4-develop/lib/internal/Magento/Framework/App/Action/Plugin
Before you continue, please remember that plugins in \Magento\Framework
were never allowed!
🤦 🤦♂️ 🤦♀️ 🤦 🤦♂️ 🤦♀️ 🤦 🤦♂️ 🤦♀️ 🤦 🤦♂️ 🤦♀️
magento2/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php
Lines 6 to 18 in 5f3b86a
namespace Magento\Framework\Module\Plugin; | |
use Magento\Framework\Cache\FrontendInterface as FrontendCacheInterface; | |
use Magento\Framework\Module\DbVersionInfo; | |
use Magento\Framework\App\FrontController; | |
use Magento\Framework\App\RequestInterface; | |
use Magento\Framework\Exception\LocalizedException; | |
use Magento\Framework\Phrase; | |
/** | |
* Validation of DB up to date state | |
*/ | |
class DbStatusValidator |
Lines 1805 to 1807 in 892dee4
<type name="Magento\Framework\DB\Adapter\AdapterInterface"> | |
<plugin name="execute_commit_callbacks" type="Magento\Framework\Model\ExecuteCommitCallbacks" /> | |
</type> |
https://github.com/magento/partners-magento2ee/blob/6d49dacca99f5276f09bbddd50866440f3d3fccc/app/code/Magento/ScalableCheckout/etc/di.xml#L34-L36
magento2/app/code/Magento/Amqp/etc/di.xml
Lines 9 to 17 in ae99625
<type name="Magento\Framework\MessageQueue\Consumer\Config\CompositeReader"> | |
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Consumer\ConfigReaderPlugin" /> | |
</type> | |
<type name="Magento\Framework\MessageQueue\Publisher\Config\CompositeReader"> | |
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Publisher\ConfigReaderPlugin" /> | |
</type> | |
<type name="Magento\Framework\MessageQueue\Topology\Config\CompositeReader"> | |
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Topology\ConfigReaderPlugin" /> | |
</type> |
magento2/app/code/Magento/Eav/etc/di.xml
Lines 108 to 110 in 4b66b00
<type name="Magento\Eav\Model\Entity\AbstractEntity"> | |
<plugin name="clean_cache" type="Magento\Framework\App\Cache\FlushCacheByTags" /> | |
</type> |
magento2/app/code/Magento/Store/etc/di.xml
Lines 36 to 38 in d938e7b
<type name="Magento\Framework\App\Response\Http"> | |
<plugin name="genericHeaderPlugin" type="Magento\Framework\App\Response\HeaderManager"/> | |
</type> |
Steps to reproduce (*)
N/A
Expected result (*)
Magento Framework shouldn't contain any plugins
Actual result (*)
- Magento Framework contains plugins, that should be misplaced in different modules, see description
Metadata
Metadata
Assignees
Labels
Type
Projects
Status