3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \Wishlist \Helper ;
7
10
8
11
use Magento \Framework \App \ActionInterface ;
@@ -117,6 +120,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
117
120
* @param \Magento\Customer\Helper\View $customerViewHelper
118
121
* @param WishlistProviderInterface $wishlistProvider
119
122
* @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
123
+ * @param Escaper $escaper
124
+ *
125
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)
120
126
*/
121
127
public function __construct (
122
128
\Magento \Framework \App \Helper \Context $ context ,
@@ -127,7 +133,8 @@ public function __construct(
127
133
\Magento \Framework \Data \Helper \PostHelper $ postDataHelper ,
128
134
\Magento \Customer \Helper \View $ customerViewHelper ,
129
135
WishlistProviderInterface $ wishlistProvider ,
130
- \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository
136
+ \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository ,
137
+ Escaper $ escaper = null
131
138
) {
132
139
$ this ->_coreRegistry = $ coreRegistry ;
133
140
$ this ->_customerSession = $ customerSession ;
@@ -137,7 +144,7 @@ public function __construct(
137
144
$ this ->_customerViewHelper = $ customerViewHelper ;
138
145
$ this ->wishlistProvider = $ wishlistProvider ;
139
146
$ this ->productRepository = $ productRepository ;
140
- $ this ->escaper = ObjectManager::getInstance ()->get (Escaper::class);
147
+ $ this ->escaper = $ escaper ?? ObjectManager::getInstance ()->get (Escaper::class);
141
148
parent ::__construct ($ context );
142
149
}
143
150
@@ -352,7 +359,6 @@ public function getAddParams($item, array $params = [])
352
359
* Retrieve params for adding product to wishlist
353
360
*
354
361
* @param int $itemId
355
- *
356
362
* @return string
357
363
*/
358
364
public function getMoveFromCartParams ($ itemId )
@@ -366,7 +372,6 @@ public function getMoveFromCartParams($itemId)
366
372
* Retrieve params for updating product in wishlist
367
373
*
368
374
* @param \Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item
369
- *
370
375
* @return string|false
371
376
*/
372
377
public function getUpdateParams ($ item )
@@ -541,6 +546,7 @@ public function getCustomerName()
541
546
*/
542
547
public function getRssUrl ($ wishlistId = null )
543
548
{
549
+ $ params = [];
544
550
$ customer = $ this ->_getCurrentCustomer ();
545
551
if ($ customer ) {
546
552
$ key = $ customer ->getId () . ', ' . $ customer ->getEmail ();
@@ -574,6 +580,7 @@ public function getDefaultWishlistName()
574
580
575
581
/**
576
582
* Calculate count of wishlist items and put value to customer session.
583
+ *
577
584
* Method called after wishlist modifications and trigger 'wishlist_items_renewed' event.
578
585
* Depends from configuration.
579
586
*
0 commit comments