From 8a6ddf61811e8c3ca1a56ee68e37c4b29e272b20 Mon Sep 17 00:00:00 2001 From: Ibrahim Saleh <19901858+IbrahimS2@users.noreply.github.com> Date: Tue, 6 May 2025 16:26:59 +0300 Subject: [PATCH] Explicit nullable type must be used instead --- Block/Product/RatingSnippet.php | 8 ++++---- Block/Richsnippet.php | 2 +- Model/Api.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Block/Product/RatingSnippet.php b/Block/Product/RatingSnippet.php index c6227aa..5984513 100644 --- a/Block/Product/RatingSnippet.php +++ b/Block/Product/RatingSnippet.php @@ -39,10 +39,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 008e214..2dd9067 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(?$sku = null, ?$product = null) { if (isset($sku) && is_array($sku)) { $sku = implode(';', $sku); diff --git a/Model/Api.php b/Model/Api.php index dee0a0e..6d59409 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, ?$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(?$magento_store_id = null) { return $this->configHelper->getRegion($magento_store_id) == 'US' ? 'api.reviews.io' : 'api.reviews.co.uk'; }