|
17 | 17 | use Magento\Framework\App\Action\HttpGetActionInterface; |
18 | 18 | use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; |
19 | 19 | use Magento\Customer\Api\Data\CustomerInterface; |
| 20 | +use Magento\Framework\App\ObjectManager; |
20 | 21 | use Magento\Framework\DataObjectFactory as ObjectFactory; |
21 | 22 | use Magento\Framework\Message\Error; |
22 | 23 | use Magento\Customer\Controller\Adminhtml\Index as CustomerAction; |
| 24 | +use Magento\Store\Model\StoreManagerInterface; |
23 | 25 |
|
24 | 26 | /** |
25 | 27 | * Class for validation of customer |
|
29 | 31 | class Validate extends CustomerAction implements HttpPostActionInterface, HttpGetActionInterface |
30 | 32 | { |
31 | 33 | /** |
32 | | - * @var SetCustomerStore |
| 34 | + * @var StoreManagerInterface |
| 35 | + */ |
| 36 | + private $storeManager; |
| 37 | + |
| 38 | + /** |
| 39 | + * @var SetCustomerStore|null |
33 | 40 | */ |
34 | 41 | private $customerStore; |
35 | 42 |
|
@@ -59,8 +66,10 @@ class Validate extends CustomerAction implements HttpPostActionInterface, HttpGe |
59 | 66 | * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory |
60 | 67 | * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory |
61 | 68 | * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory |
62 | | - * @param SetCustomerStore $customerStore |
| 69 | + * @param StoreManagerInterface|null $storeManager |
| 70 | + * @param SetCustomerStore|null $customerStore |
63 | 71 | * @SuppressWarnings(PHPMD.ExcessiveParameterList) |
| 72 | + * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
64 | 73 | */ |
65 | 74 | public function __construct( |
66 | 75 | \Magento\Backend\App\Action\Context $context, |
@@ -88,7 +97,8 @@ public function __construct( |
88 | 97 | \Magento\Framework\View\Result\PageFactory $resultPageFactory, |
89 | 98 | \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, |
90 | 99 | \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, |
91 | | - SetCustomerStore $customerStore |
| 100 | + ?StoreManagerInterface $storeManager = null, |
| 101 | + ?SetCustomerStore $customerStore = null |
92 | 102 | ) { |
93 | 103 | parent::__construct( |
94 | 104 | $context, |
@@ -117,7 +127,8 @@ public function __construct( |
117 | 127 | $resultForwardFactory, |
118 | 128 | $resultJsonFactory |
119 | 129 | ); |
120 | | - $this->customerStore = $customerStore; |
| 130 | + $this->storeManager = $storeManager ?? ObjectManager::getInstance()->get(StoreManagerInterface::class); |
| 131 | + $this->customerStore = $customerStore ?? ObjectManager::getInstance()->get(SetCustomerStore::class); |
121 | 132 | } |
122 | 133 |
|
123 | 134 | /** |
|
0 commit comments