66
77namespace Magento \Wishlist \Block ;
88
9- use Magento \Catalog \Block \Product \Context ;
109use Magento \Catalog \Helper \Image ;
1110use Magento \Catalog \Model \Product \Image \UrlBuilder ;
12- use Magento \Framework \Exception \NoSuchEntityException ;
1311use Magento \Framework \View \ConfigInterface ;
1412use Magento \Framework \App \ObjectManager ;
15- use Magento \Wishlist \Model \WishlistItemPermissionsCollectionProcessor ;
1613
1714/**
1815 * Wishlist Product Items abstract Block
19- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2016 */
2117abstract class AbstractBlock extends \Magento \Catalog \Block \Product \AbstractProduct
2218{
@@ -50,25 +46,18 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd
5046 private $ imageUrlBuilder ;
5147
5248 /**
53- * @var WishlistItemPermissionsCollectionProcessor
54- */
55- private $ permissionCollectionProcessor ;
56-
57- /**
58- * @param Context $context
49+ * @param \Magento\Catalog\Block\Product\Context $context
5950 * @param \Magento\Framework\App\Http\Context $httpContext
6051 * @param array $data
6152 * @param ConfigInterface|null $config
6253 * @param UrlBuilder|null $urlBuilder
63- * @param WishlistItemPermissionsCollectionProcessor|null $permissionCollectionProcessor
6454 */
6555 public function __construct (
6656 \Magento \Catalog \Block \Product \Context $ context ,
6757 \Magento \Framework \App \Http \Context $ httpContext ,
6858 array $ data = [],
6959 ?ConfigInterface $ config = null ,
70- ?UrlBuilder $ urlBuilder = null ,
71- ?WishlistItemPermissionsCollectionProcessor $ permissionCollectionProcessor = null
60+ ?UrlBuilder $ urlBuilder = null
7261 ) {
7362 $ this ->httpContext = $ httpContext ;
7463 parent ::__construct (
@@ -77,8 +66,6 @@ public function __construct(
7766 );
7867 $ this ->viewConfig = $ config ?? ObjectManager::getInstance ()->get (ConfigInterface::class);
7968 $ this ->imageUrlBuilder = $ urlBuilder ?? ObjectManager::getInstance ()->get (UrlBuilder::class);
80- $ this ->permissionCollectionProcessor = $ permissionCollectionProcessor ??
81- ObjectManager::getInstance ()->get (WishlistItemPermissionsCollectionProcessor::class);
8269 }
8370
8471 /**
@@ -117,12 +104,10 @@ protected function _prepareCollection($collection)
117104 * Create wishlist item collection
118105 *
119106 * @return \Magento\Wishlist\Model\ResourceModel\Item\Collection
120- * @throws NoSuchEntityException
121107 */
122108 protected function _createWishlistItemCollection ()
123109 {
124- $ itemCollection = $ this ->_getWishlist ()->getItemCollection ();
125- return $ this ->permissionCollectionProcessor ->execute ($ itemCollection );
110+ return $ this ->_getWishlist ()->getItemCollection ();
126111 }
127112
128113 /**
@@ -247,7 +232,6 @@ public function hasDescription($item)
247232 *
248233 * @param string $date
249234 * @deprecated 101.1.1
250- * @see getFormattedDate
251235 * @return string
252236 */
253237 public function getFormatedDate ($ date )
0 commit comments