diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c643cd7..75c93fd0 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGE LOG +## 3.13.8 + +### Bug Fixes +- Restored compatibility with PHP 7.4 + ## 3.13.7 ### Features diff --git a/Model/Config/AutomaticPriceIndexingComment.php b/Model/Config/AutomaticPriceIndexingComment.php index 89201fa7..a564a586 100644 --- a/Model/Config/AutomaticPriceIndexingComment.php +++ b/Model/Config/AutomaticPriceIndexingComment.php @@ -7,9 +7,16 @@ class AutomaticPriceIndexingComment implements CommentInterface { + /** + * @var UrlInterface + */ + protected $urlInterface; + public function __construct( - protected UrlInterface $urlInterface - ) { } + UrlInterface $urlInterface + ) { + $this->urlInterface = $urlInterface; + } public function getCommentText($elementValue) { diff --git a/Plugin/AddToCartRedirectForInsights.php b/Plugin/AddToCartRedirectForInsights.php index df9f3b95..603ffb33 100644 --- a/Plugin/AddToCartRedirectForInsights.php +++ b/Plugin/AddToCartRedirectForInsights.php @@ -22,14 +22,51 @@ class AddToCartRedirectForInsights */ private $requestInfoFilter; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var ProductRepositoryInterface + */ + protected $productRepository; + + /** + * @var Session + */ + protected $checkoutSession; + + /** + * @var StockRegistryInterface + */ + protected $stockRegistry; + + /** + * @var ManagerInterface + */ + protected ManagerInterface $eventManager; + + /** + * @var ConfigHelper + */ + protected ConfigHelper $configHelper; + public function __construct( - protected StoreManagerInterface $storeManager, - protected ProductRepositoryInterface $productRepository, - protected Session $checkoutSession, - protected StockRegistryInterface $stockRegistry, - protected ManagerInterface $eventManager, - protected ConfigHelper $configHelper, - ) {} + StoreManagerInterface $storeManager, + ProductRepositoryInterface $productRepository, + Session $checkoutSession, + StockRegistryInterface $stockRegistry, + ManagerInterface $eventManager, + ConfigHelper $configHelper + ) { + $this->storeManager = $storeManager; + $this->productRepository = $productRepository; + $this->checkoutSession = $checkoutSession; + $this->stockRegistry = $stockRegistry; + $this->eventManager = $eventManager; + $this->configHelper = $configHelper; + } /** * @param Cart $cartModel @@ -41,7 +78,7 @@ public function __construct( * @throws LocalizedException * @throws NoSuchEntityException */ - public function beforeAddProduct(Cart $cartModel, int|Product $productInfo, array|int|DataObject $requestInfo = null) + public function beforeAddProduct(Cart $cartModel, $productInfo, $requestInfo = null) { // First, check is Insights are enabled if (!$this->configHelper->isClickConversionAnalyticsEnabled($this->storeManager->getStore()->getId())) { diff --git a/README.md b/README.md index ec374821..83f4fa96 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Algolia Search & Discovery extension for Magento 2 ================================================== -![Latest version](https://img.shields.io/badge/latest-3.13.7-green) +![Latest version](https://img.shields.io/badge/latest-3.13.8-green) ![Magento 2](https://img.shields.io/badge/Magento-2.4.x-orange) ![PHP](https://img.shields.io/badge/PHP-8.2%2C8.1%2C7.4-blue) diff --git a/Service/Product/MissingPriceIndexHandler.php b/Service/Product/MissingPriceIndexHandler.php index af112c53..dde0e438 100644 --- a/Service/Product/MissingPriceIndexHandler.php +++ b/Service/Product/MissingPriceIndexHandler.php @@ -19,14 +19,36 @@ class MissingPriceIndexHandler protected array $_indexedProducts = []; - protected IndexerInterface $indexer; + /** + * @var CollectionFactory + */ + protected $productCollectionFactory; + + /** + * @var ResourceConnection + */ + protected $resourceConnection; + + /** + * @var Logger + */ + protected $logger; + + /** + * @var IndexerInterface + */ + protected $indexer; + public function __construct( - protected CollectionFactory $productCollectionFactory, - protected ResourceConnection $resourceConnection, - protected Logger $logger, + CollectionFactory $productCollectionFactory, + ResourceConnection $resourceConnection, + Logger $logger, IndexerRegistry $indexerRegistry ) { + $this->productCollectionFactory = $productCollectionFactory; + $this->resourceConnection = $resourceConnection; + $this->logger = $logger; $this->indexer = $indexerRegistry->get('catalog_product_price'); } @@ -34,7 +56,7 @@ public function __construct( * @param string[]|ProductCollection $products * @return string[] Array of product IDs that were reindexed by this repair operation */ - public function refreshPriceIndex(array|ProductCollection $products): array + public function refreshPriceIndex($products): array { $reindexIds = $this->getProductIdsToReindex($products); if (empty($reindexIds)) { @@ -54,7 +76,7 @@ public function refreshPriceIndex(array|ProductCollection $products): array * @param string[]|ProductCollection $products - either an explicit list of product ids or a product collection * @return string[] IDs of products that require price reindexing (will be empty if no indexing is required) */ - protected function getProductIdsToReindex(array|ProductCollection $products): array + protected function getProductIdsToReindex($products): array { $productIds = $products instanceof ProductCollection ? $this->getProductIdsFromCollection($products) diff --git a/composer.json b/composer.json index e85cd4c9..dc7a9b4d 100755 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Algolia Search & Discovery extension for Magento 2", "type": "magento2-module", "license": ["MIT"], - "version": "3.13.7", + "version": "3.13.8", "require": { "magento/framework": "~102.0|~103.0", "algolia/algoliasearch-client-php": "3.3.2", diff --git a/etc/module.xml b/etc/module.xml index e1d3c8bf..e0ad96a0 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +