7
7
8
8
use Magento \Catalog \Controller \Product \View \ViewInterface ;
9
9
use Magento \Checkout \Model \Cart as CustomerCart ;
10
- use Magento \Framework \Escaper ;
11
10
12
11
/**
13
12
* Shopping cart controller
@@ -43,14 +42,15 @@ abstract class Cart extends \Magento\Framework\App\Action\Action implements View
43
42
* @var \Magento\Framework\Escaper
44
43
*/
45
44
protected $ escaper ;
46
-
45
+
47
46
/**
48
47
* @param \Magento\Framework\App\Action\Context $context
49
48
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
50
49
* @param \Magento\Checkout\Model\Session $checkoutSession
51
50
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
52
51
* @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator
53
52
* @param CustomerCart $cart
53
+ * @param \Magento\Framework\Escaper $escaper
54
54
* @codeCoverageIgnore
55
55
*/
56
56
public function __construct (
@@ -60,14 +60,14 @@ public function __construct(
60
60
\Magento \Store \Model \StoreManagerInterface $ storeManager ,
61
61
\Magento \Framework \Data \Form \FormKey \Validator $ formKeyValidator ,
62
62
CustomerCart $ cart ,
63
- Escaper $ escaper
63
+ \ Magento \ Framework \ Escaper $ escaper = null
64
64
) {
65
65
$ this ->_formKeyValidator = $ formKeyValidator ;
66
66
$ this ->_scopeConfig = $ scopeConfig ;
67
67
$ this ->_checkoutSession = $ checkoutSession ;
68
68
$ this ->_storeManager = $ storeManager ;
69
69
$ this ->cart = $ cart ;
70
- $ this ->escaper = $ escaper ;
70
+ $ this ->escaper = $ escaper ?: \ Magento \ Framework \ App \ObjectManager:: getInstance ()-> get (\ Magento \ Framework \Escaper::class) ;
71
71
parent ::__construct ($ context );
72
72
}
73
73
0 commit comments