33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \Wishlist \Helper ;
710
811use Magento \Framework \App \ActionInterface ;
@@ -117,6 +120,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
117120 * @param \Magento\Customer\Helper\View $customerViewHelper
118121 * @param WishlistProviderInterface $wishlistProvider
119122 * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
123+ * @param Escaper $escaper
124+ *
125+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)
120126 */
121127 public function __construct (
122128 \Magento \Framework \App \Helper \Context $ context ,
@@ -127,7 +133,8 @@ public function __construct(
127133 \Magento \Framework \Data \Helper \PostHelper $ postDataHelper ,
128134 \Magento \Customer \Helper \View $ customerViewHelper ,
129135 WishlistProviderInterface $ wishlistProvider ,
130- \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository
136+ \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository ,
137+ Escaper $ escaper = null
131138 ) {
132139 $ this ->_coreRegistry = $ coreRegistry ;
133140 $ this ->_customerSession = $ customerSession ;
@@ -137,7 +144,7 @@ public function __construct(
137144 $ this ->_customerViewHelper = $ customerViewHelper ;
138145 $ this ->wishlistProvider = $ wishlistProvider ;
139146 $ this ->productRepository = $ productRepository ;
140- $ this ->escaper = ObjectManager::getInstance ()->get (Escaper::class);
147+ $ this ->escaper = $ escaper ?? ObjectManager::getInstance ()->get (Escaper::class);
141148 parent ::__construct ($ context );
142149 }
143150
@@ -352,7 +359,6 @@ public function getAddParams($item, array $params = [])
352359 * Retrieve params for adding product to wishlist
353360 *
354361 * @param int $itemId
355- *
356362 * @return string
357363 */
358364 public function getMoveFromCartParams ($ itemId )
@@ -366,7 +372,6 @@ public function getMoveFromCartParams($itemId)
366372 * Retrieve params for updating product in wishlist
367373 *
368374 * @param \Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item
369- *
370375 * @return string|false
371376 */
372377 public function getUpdateParams ($ item )
@@ -541,6 +546,7 @@ public function getCustomerName()
541546 */
542547 public function getRssUrl ($ wishlistId = null )
543548 {
549+ $ params = [];
544550 $ customer = $ this ->_getCurrentCustomer ();
545551 if ($ customer ) {
546552 $ key = $ customer ->getId () . ', ' . $ customer ->getEmail ();
@@ -574,6 +580,7 @@ public function getDefaultWishlistName()
574580
575581 /**
576582 * Calculate count of wishlist items and put value to customer session.
583+ *
577584 * Method called after wishlist modifications and trigger 'wishlist_items_renewed' event.
578585 * Depends from configuration.
579586 *
0 commit comments