Skip to content

Commit 58ee67d

Browse files
authored
Checkout Controller Cart > Backward compatible
1 parent 57c5fed commit 58ee67d

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Checkout/Controller

1 file changed

+4
-4
lines changed

app/code/Magento/Checkout/Controller/Cart.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Catalog\Controller\Product\View\ViewInterface;
99
use Magento\Checkout\Model\Cart as CustomerCart;
10-
use Magento\Framework\Escaper;
1110

1211
/**
1312
* Shopping cart controller
@@ -43,14 +42,15 @@ abstract class Cart extends \Magento\Framework\App\Action\Action implements View
4342
* @var \Magento\Framework\Escaper
4443
*/
4544
protected $escaper;
46-
45+
4746
/**
4847
* @param \Magento\Framework\App\Action\Context $context
4948
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
5049
* @param \Magento\Checkout\Model\Session $checkoutSession
5150
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
5251
* @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator
5352
* @param CustomerCart $cart
53+
* @param \Magento\Framework\Escaper $escaper
5454
* @codeCoverageIgnore
5555
*/
5656
public function __construct(
@@ -60,14 +60,14 @@ public function __construct(
6060
\Magento\Store\Model\StoreManagerInterface $storeManager,
6161
\Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
6262
CustomerCart $cart,
63-
Escaper $escaper
63+
\Magento\Framework\Escaper $escaper = null
6464
) {
6565
$this->_formKeyValidator = $formKeyValidator;
6666
$this->_scopeConfig = $scopeConfig;
6767
$this->_checkoutSession = $checkoutSession;
6868
$this->_storeManager = $storeManager;
6969
$this->cart = $cart;
70-
$this->escaper = $escaper;
70+
$this->escaper = $escaper ?: \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Escaper::class);
7171
parent::__construct($context);
7272
}
7373

0 commit comments

Comments
 (0)