Skip to content

Commit 34cc977

Browse files
ENGCOM-7484: #27962 Migrate Plugin out of Framework (to Theme module) #27965
- Merge Pull Request #27965 from lbajsarowicz/magento2:bugfix/move-plugin - Merged commits: 1. d938e7b 2. ae58f56 3. 02aae13 4. a84633e 5. 7ff6063
2 parents a94aa00 + 7ff6063 commit 34cc977

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

app/code/Magento/Store/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
<preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Store\Model\PathConfig" />
6666
<type name="Magento\Framework\App\ActionInterface">
6767
<plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck"/>
68-
<plugin name="designLoader" type="Magento\Framework\App\Action\Plugin\LoadDesignPlugin"/>
6968
<plugin name="eventDispatch" type="Magento\Framework\App\Action\Plugin\EventDispatchPlugin"/>
7069
<plugin name="actionFlagNoDispatch" type="Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin"/>
7170
</type>

lib/internal/Magento/Framework/App/Action/Plugin/LoadDesignPlugin.php renamed to app/code/Magento/Theme/Plugin/LoadDesignPlugin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Framework\App\Action\Plugin;
7+
namespace Magento\Theme\Plugin;
88

99
use Magento\Framework\App\ActionInterface;
1010
use Magento\Framework\Config\Dom\ValidationException;
@@ -21,12 +21,12 @@ class LoadDesignPlugin
2121
/**
2222
* @var DesignLoader
2323
*/
24-
protected $_designLoader;
24+
private $designLoader;
2525

2626
/**
2727
* @var MessageManagerInterface
2828
*/
29-
protected $messageManager;
29+
private $messageManager;
3030

3131
/**
3232
* @param DesignLoader $designLoader
@@ -36,7 +36,7 @@ public function __construct(
3636
DesignLoader $designLoader,
3737
MessageManagerInterface $messageManager
3838
) {
39-
$this->_designLoader = $designLoader;
39+
$this->designLoader = $designLoader;
4040
$this->messageManager = $messageManager;
4141
}
4242

@@ -50,7 +50,7 @@ public function __construct(
5050
public function beforeExecute(ActionInterface $subject)
5151
{
5252
try {
53-
$this->_designLoader->load();
53+
$this->designLoader->load();
5454
} catch (LocalizedException $e) {
5555
if ($e->getPrevious() instanceof ValidationException) {
5656
/** @var MessageInterface $message */
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
declare(strict_types=1);
7-
8-
namespace Magento\Framework\App\Test\Unit\Action\Plugin;
6+
namespace Magento\Theme\Test\Unit\Plugin;
97

108
use Magento\Framework\App\Action\Action;
11-
use Magento\Framework\App\Action\Plugin\LoadDesignPlugin;
129
use Magento\Framework\App\ActionInterface;
1310
use Magento\Framework\Message\ManagerInterface;
1411
use Magento\Framework\View\DesignLoader;
12+
use Magento\Theme\Plugin\LoadDesignPlugin;
1513
use PHPUnit\Framework\MockObject\MockObject;
1614
use PHPUnit\Framework\TestCase;
1715

@@ -26,7 +24,7 @@ public function testBeforeExecute()
2624
$designLoaderMock = $this->createMock(DesignLoader::class);
2725

2826
/** @var MockObject|ManagerInterface $messageManagerMock */
29-
$messageManagerMock = $this->getMockForAbstractClass(ManagerInterface::class);
27+
$messageManagerMock = $this->createMock(ManagerInterface::class);
3028

3129
$plugin = new LoadDesignPlugin($designLoaderMock, $messageManagerMock);
3230

app/code/Magento/Theme/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105
<argument name="scope" xsi:type="const">Magento\Store\Model\ScopeInterface::SCOPE_STORE</argument>
106106
</arguments>
107107
</virtualType>
108+
<type name="Magento\Framework\App\ActionInterface">
109+
<plugin name="designLoader" type="Magento\Theme\Plugin\LoadDesignPlugin"/>
110+
</type>
108111
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
109112
<arguments>
110113
<argument name="collections" xsi:type="array">

0 commit comments

Comments
 (0)