|
3 | 3 | * Copyright © Magento, Inc. All rights reserved. |
4 | 4 | * See COPYING.txt for license details. |
5 | 5 | */ |
| 6 | +declare(strict_types=1); |
| 7 | + |
6 | 8 | namespace Magento\Wishlist\Controller\Shared; |
7 | 9 |
|
8 | 10 | use Magento\Catalog\Model\Product\Exception as ProductException; |
9 | 11 | use Magento\Checkout\Helper\Cart as CartHelper; |
10 | 12 | use Magento\Checkout\Model\Cart as CustomerCart; |
| 13 | +use Magento\Framework\App\Action\Action; |
11 | 14 | use Magento\Framework\App\Action\Context as ActionContext; |
12 | | -use Magento\Framework\App\Action\HttpGetActionInterface; |
| 15 | +use Magento\Framework\App\Action\HttpPostActionInterface; |
| 16 | +use Magento\Framework\Controller\Result\Redirect; |
13 | 17 | use Magento\Framework\Controller\ResultFactory; |
14 | 18 | use Magento\Framework\Escaper; |
15 | 19 | use Magento\Framework\Exception\LocalizedException; |
|
23 | 27 | * |
24 | 28 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
25 | 29 | */ |
26 | | -class Cart extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface |
| 30 | +class Cart extends Action implements HttpPostActionInterface |
27 | 31 | { |
28 | 32 | /** |
29 | 33 | * @var CustomerCart |
@@ -80,7 +84,7 @@ public function __construct( |
80 | 84 | * If Product has required options - redirect |
81 | 85 | * to product view page with message about needed defined required options |
82 | 86 | * |
83 | | - * @return \Magento\Framework\Controller\Result\Redirect |
| 87 | + * @return Redirect |
84 | 88 | */ |
85 | 89 | public function execute() |
86 | 90 | { |
@@ -120,7 +124,7 @@ public function execute() |
120 | 124 | } catch (\Exception $e) { |
121 | 125 | $this->messageManager->addExceptionMessage($e, __('We can\'t add the item to the cart right now.')); |
122 | 126 | } |
123 | | - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ |
| 127 | + /** @var Redirect $resultRedirect */ |
124 | 128 | $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); |
125 | 129 | $resultRedirect->setUrl($redirectUrl); |
126 | 130 | return $resultRedirect; |
|
0 commit comments