Skip to content

Commit

Permalink
removed unnecessary properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudolf Vince committed Jun 29, 2020
1 parent 4a85364 commit 979ab1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 56 deletions.
19 changes: 1 addition & 18 deletions app/code/Magento/Wishlist/Controller/Shared/Allcart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -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);
Expand Down
41 changes: 3 additions & 38 deletions app/code/Magento/Wishlist/Controller/Shared/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,59 +55,27 @@ 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
* @param OptionFactory $optionFactory
* @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,
CustomerCart $cart,
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);
}

Expand All @@ -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 */
Expand Down

0 comments on commit 979ab1f

Please sign in to comment.