diff --git a/Block/Product/RatingSnippet.php b/Block/Product/RatingSnippet.php index c6227aa..d25023a 100644 --- a/Block/Product/RatingSnippet.php +++ b/Block/Product/RatingSnippet.php @@ -14,12 +14,19 @@ class RatingSnippet extends ListProduct { + // protected $_storeManager = StoreManagerInterface::class; protected $_customerSession; + protected $reviewsConfig; + protected $postDataHelper; + protected $layerResolver; + protected $categoryRepository; + protected $urlHelper; + protected $customerSession; protected $categoryFactory; - //protected $reviewsConfig = Reviews\Helper\Config; - // protected $_storeManager = StoreManagerInterface::class; + protected $reviewsConfigHelper; + protected $storeManager; protected $store; - protected $reviewsConfig; + /** * ListProduct constructor. * @param \Magento\Catalog\Block\Product\Context $context @@ -27,10 +34,11 @@ class RatingSnippet extends ListProduct * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository * @param \Magento\Framework\Url\Helper\Data $urlHelper - * @param Helper $helper * @param array $data * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Reviewscouk\Reviews\Helper\Config $reviewsConfigHelper + * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( \Magento\Catalog\Block\Product\Context $context, @@ -39,10 +47,10 @@ public function __construct( \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository, \Magento\Framework\Url\Helper\Data $urlHelper, array $data = [], - \Magento\Customer\Model\Session $customerSession = null, - \Magento\Catalog\Model\CategoryFactory $categoryFactory = null, - ReviewsConfig $reviewsConfigHelper = null, - StoreManagerInterface $storeManager = null + ?\Magento\Customer\Model\Session $customerSession = null, + ?\Magento\Catalog\Model\CategoryFactory $categoryFactory = null, + ?ReviewsConfig $reviewsConfigHelper = null, + ?StoreManagerInterface $storeManager = null ) { $this->_customerSession = $customerSession; $this->categoryFactory = $categoryFactory; diff --git a/Block/Richsnippet.php b/Block/Richsnippet.php index 8652c41..b539cb6 100755 --- a/Block/Richsnippet.php +++ b/Block/Richsnippet.php @@ -85,7 +85,7 @@ public function getRichSnippetSource() return ''; } - public function getRichSnippet($sku = null, $product = null) + public function getRichSnippet(?array $sku = null, ?array $product = null) { if (isset($sku) && is_array($sku)) { $sku = implode(';', $sku); diff --git a/Model/Api.php b/Model/Api.php index dee0a0e..79cca68 100755 --- a/Model/Api.php +++ b/Model/Api.php @@ -25,7 +25,7 @@ public function __construct( $this->store = $storeManagerInterface->getStore(); } - public function apiPost($url, $data, $magento_store_id = null) + public function apiPost($url, $data, ?string $magento_store_id = null) { if ($magento_store_id == null) { $magento_store_id = $this->store->getId(); @@ -51,7 +51,7 @@ public function apiPost($url, $data, $magento_store_id = null) return $response; } - protected function getApiDomain($magento_store_id = null) + protected function getApiDomain(?string $magento_store_id = null) { return $this->configHelper->getRegion($magento_store_id) == 'US' ? 'api.reviews.io' : 'api.reviews.co.uk'; } diff --git a/README.md b/README.md index f74c094..bafe7a0 100755 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ You'll need to sign up at [Reviews.co.uk](https://www.reviews.co.uk "Reviews.co. | Magento Version | Php Version | REVIEWS.io Plugin Version | |-----------------|-------------|----------------------------| +| >= 2.4.8 | 8.3, 8.4 | reviewscouk/reviews:0.0.67 | | >= 2.4.6 | 8.1, 8.2 | reviewscouk/reviews:0.0.66 | | >= 2.4.4 | 8.1 | reviewscouk/reviews:0.0.66 | | <= 2.4.3 | <= 7.4 | reviewscouk/reviews:0.0.66 | @@ -18,7 +19,7 @@ You'll need to sign up at [Reviews.co.uk](https://www.reviews.co.uk "Reviews.co. 2. As this plugin is hosted on [packagist.org](http://packagist.org), you simply use the following to instruct composer to fetch and install the module: ```bash - composer require reviewscouk/reviews:0.0.66 + composer require reviewscouk/reviews:0.0.67 ``` 3. When this is complete, `cd` to `/bin` and run the following: