diff --git a/app/code/Magento/Wishlist/Controller/Shared/Allcart.php b/app/code/Magento/Wishlist/Controller/Shared/Allcart.php index 17ee92e8c1307..96b3102a6f443 100644 --- a/app/code/Magento/Wishlist/Controller/Shared/Allcart.php +++ b/app/code/Magento/Wishlist/Controller/Shared/Allcart.php @@ -11,7 +11,6 @@ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\App\Action\HttpGetActionInterface; -use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Forward; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultFactory; @@ -29,33 +28,17 @@ class Allcart extends Action implements HttpGetActionInterface */ private $wishlistProvider; - /** - * @var RequestInterface - */ - private $request; - - /** - * @var ResultFactory - */ - private $resultFactory; - /** * @param Context $context * @param ItemCarrier $itemCarrier - * @param RequestInterface $request - * @param ResultFactory $resultFactory * @param WishlistProvider $wishlistProvider */ public function __construct( Context $context, ItemCarrier $itemCarrier, - RequestInterface $request, - ResultFactory $resultFactory, WishlistProvider $wishlistProvider ) { $this->itemCarrier = $itemCarrier; - $this->request = $request; - $this->resultFactory = $resultFactory; $this->wishlistProvider = $wishlistProvider; parent::__construct($context); } @@ -74,7 +57,7 @@ public function execute() $resultForward->forward('noroute'); return $resultForward; } - $redirectUrl = $this->itemCarrier->moveAllToCart($wishlist, $this->request->getParam('qty')); + $redirectUrl = $this->itemCarrier->moveAllToCart($wishlist, $this->getRequest()->getParam('qty')); /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $resultRedirect->setUrl($redirectUrl); diff --git a/app/code/Magento/Wishlist/Controller/Shared/Cart.php b/app/code/Magento/Wishlist/Controller/Shared/Cart.php index b6e7904ae412c..9fdadb917a920 100644 --- a/app/code/Magento/Wishlist/Controller/Shared/Cart.php +++ b/app/code/Magento/Wishlist/Controller/Shared/Cart.php @@ -14,13 +14,10 @@ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context as ActionContext; use Magento\Framework\App\Action\HttpGetActionInterface; -use Magento\Framework\App\RequestInterface; -use Magento\Framework\App\Response\RedirectInterface; use Magento\Framework\Controller\Result\Redirect as ResultRedirect; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Escaper; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Message\ManagerInterface as MessageManagerInterface; use Magento\Wishlist\Model\Item; use Magento\Wishlist\Model\Item\OptionFactory; use Magento\Wishlist\Model\ItemFactory; @@ -58,26 +55,6 @@ class Cart extends Action implements HttpGetActionInterface */ private $escaper; - /** - * @var RequestInterface - */ - private $request; - - /** - * @var RedirectInterface - */ - private $redirect; - - /** - * @var MessageManagerInterface - */ - private $messageManager; - - /** - * @var ResultFactory - */ - private $resultFactory; - /** * @param ActionContext $context * @param CustomerCart $cart @@ -85,10 +62,6 @@ class Cart extends Action implements HttpGetActionInterface * @param ItemFactory $itemFactory * @param CartHelper $cartHelper * @param Escaper $escaper - * @param RequestInterface $request - * @param RedirectInterface $redirect - * @param MessageManagerInterface $messageManager - * @param ResultFactory $resultFactory */ public function __construct( ActionContext $context, @@ -96,21 +69,13 @@ public function __construct( OptionFactory $optionFactory, ItemFactory $itemFactory, CartHelper $cartHelper, - Escaper $escaper, - RequestInterface $request, - RedirectInterface $redirect, - MessageManagerInterface $messageManager, - ResultFactory $resultFactory + Escaper $escaper ) { $this->cart = $cart; $this->optionFactory = $optionFactory; $this->itemFactory = $itemFactory; $this->cartHelper = $cartHelper; $this->escaper = $escaper; - $this->request = $request; - $this->redirect = $redirect; - $this->messageManager = $messageManager; - $this->resultFactory = $resultFactory; parent::__construct($context); } @@ -124,13 +89,13 @@ public function __construct( */ public function execute() { - $itemId = (int)$this->request->getParam('item'); + $itemId = (int)$this->getRequest()->getParam('item'); /* @var $item Item */ $item = $this->itemFactory->create() ->load($itemId); - $redirectUrl = $this->redirect->getRefererUrl(); + $redirectUrl = $this->_redirect->getRefererUrl(); try { /** @var OptionCollection $options */