From 7ec97800d826aeb186c9c17ad2617d9bba022cbb Mon Sep 17 00:00:00 2001 From: vpashovski Date: Thu, 20 Nov 2025 11:27:13 +0200 Subject: [PATCH 1/2] Fix: Deprecated Functionality: Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used; --- Block/Adminhtml/Order/Create/Installation.php | 2 +- Console/Command/CreateContracts.php | 2 +- Console/Command/CreateWarrantyProduct.php | 2 +- Console/Command/ResetProductSyncFlag.php | 2 +- Console/Command/SendOrders.php | 2 +- Console/Command/SyncProducts.php | 2 +- Model/Config/Backend/ContractCreationCronSchedule.php | 4 ++-- Model/Config/Backend/OrdersSyncCronSchedule.php | 4 ++-- Model/Config/Backend/ProductSyncCronSchedule.php | 4 ++-- Model/Product/Type.php | 2 +- Model/ProductSyncProcess.php | 2 +- ViewModel/Warranty.php | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Block/Adminhtml/Order/Create/Installation.php b/Block/Adminhtml/Order/Create/Installation.php index ee846c26..4ed3242e 100644 --- a/Block/Adminhtml/Order/Create/Installation.php +++ b/Block/Adminhtml/Order/Create/Installation.php @@ -23,7 +23,7 @@ class Installation extends Template public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Model\Session\Quote $quote = null, + ?\Magento\Backend\Model\Session\Quote $quote = null, array $data = [] ){ $this->quote = $quote ?? \Magento\Framework\App\ObjectManager::getInstance() diff --git a/Console/Command/CreateContracts.php b/Console/Command/CreateContracts.php index 129f2522..a9fb6f77 100644 --- a/Console/Command/CreateContracts.php +++ b/Console/Command/CreateContracts.php @@ -70,7 +70,7 @@ public function __construct( DataHelper $dataHelper, ContractCreateProcess $contractCreateProcess, LoggerInterface $logger, - string $name = null + ?string $name = null ) { $this->appState = $appState; $this->dataHelper = $dataHelper; diff --git a/Console/Command/CreateWarrantyProduct.php b/Console/Command/CreateWarrantyProduct.php index 0afa714c..f1fca48e 100644 --- a/Console/Command/CreateWarrantyProduct.php +++ b/Console/Command/CreateWarrantyProduct.php @@ -86,7 +86,7 @@ public function __construct( LoggerInterface $logger, ResourceProductFactory $resourceProductFactory, StoreManagerInterface $storeManager, - string $name = null + ?string $name = null ) { parent::__construct($name); $this->productRepository = $productRepository; diff --git a/Console/Command/ResetProductSyncFlag.php b/Console/Command/ResetProductSyncFlag.php index c8ba97b3..0ffdcbb5 100644 --- a/Console/Command/ResetProductSyncFlag.php +++ b/Console/Command/ResetProductSyncFlag.php @@ -60,7 +60,7 @@ public function __construct( AppState $appState, FlagManager $flagManager, LoggerInterface $logger, - string $name = null + ?string $name = null ) { $this->appState = $appState; $this->flagManager = $flagManager; diff --git a/Console/Command/SendOrders.php b/Console/Command/SendOrders.php index d18e13af..a23ee915 100644 --- a/Console/Command/SendOrders.php +++ b/Console/Command/SendOrders.php @@ -104,7 +104,7 @@ public function __construct( HistoricalOrdersSyncProcess $sendHistoricalOrders, GetAfterDate $getAfterDate, LoggerInterface $logger, - string $name = null + ?string $name = null ) { parent::__construct($name); $this->appState = $appState; diff --git a/Console/Command/SyncProducts.php b/Console/Command/SyncProducts.php index 69fa2d17..87478413 100644 --- a/Console/Command/SyncProducts.php +++ b/Console/Command/SyncProducts.php @@ -88,7 +88,7 @@ public function __construct( FlagManager $flagManager, ProductSyncProcess $productSyncProcess, LoggerInterface $logger, - string $name = null + ?string $name = null ) { parent::__construct($name); $this->appState = $appState; diff --git a/Model/Config/Backend/ContractCreationCronSchedule.php b/Model/Config/Backend/ContractCreationCronSchedule.php index f7e2638d..e254dff6 100644 --- a/Model/Config/Backend/ContractCreationCronSchedule.php +++ b/Model/Config/Backend/ContractCreationCronSchedule.php @@ -52,8 +52,8 @@ public function __construct( ScopeConfigInterface $config, TypeListInterface $cacheTypeList, Helper $helper, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, array $data = [] ) { $this->helper = $helper; diff --git a/Model/Config/Backend/OrdersSyncCronSchedule.php b/Model/Config/Backend/OrdersSyncCronSchedule.php index 2dbca8ed..cd2d23d9 100644 --- a/Model/Config/Backend/OrdersSyncCronSchedule.php +++ b/Model/Config/Backend/OrdersSyncCronSchedule.php @@ -50,8 +50,8 @@ public function __construct( ScopeConfigInterface $config, TypeListInterface $cacheTypeList, Helper $helper, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, array $data = [] ) { $this->helper = $helper; diff --git a/Model/Config/Backend/ProductSyncCronSchedule.php b/Model/Config/Backend/ProductSyncCronSchedule.php index 52c9e06d..92fd4937 100644 --- a/Model/Config/Backend/ProductSyncCronSchedule.php +++ b/Model/Config/Backend/ProductSyncCronSchedule.php @@ -52,8 +52,8 @@ public function __construct( ScopeConfigInterface $config, TypeListInterface $cacheTypeList, Helper $helper, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, array $data = [] ) { $this->helper = $helper; diff --git a/Model/Product/Type.php b/Model/Product/Type.php index f5142261..66370b5c 100644 --- a/Model/Product/Type.php +++ b/Model/Product/Type.php @@ -94,7 +94,7 @@ public function __construct( \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository, Data $helper, - \Magento\Framework\Serialize\Serializer\Json $serializer = null + ?\Magento\Framework\Serialize\Serializer\Json $serializer = null ) { $this->helper = $helper; diff --git a/Model/ProductSyncProcess.php b/Model/ProductSyncProcess.php index 12e94610..cec64a5e 100644 --- a/Model/ProductSyncProcess.php +++ b/Model/ProductSyncProcess.php @@ -125,7 +125,7 @@ public function __construct( * @param int|null $defaultBatchSize * @return void */ - public function execute(int $defaultBatchSize = null) + public function execute(?int $defaultBatchSize = null) { $stores = $this->storeManager->getStores(); foreach ($stores as $storeId => $store) { diff --git a/ViewModel/Warranty.php b/ViewModel/Warranty.php index 9e0866aa..f9e6b9ba 100644 --- a/ViewModel/Warranty.php +++ b/ViewModel/Warranty.php @@ -193,7 +193,7 @@ public function __construct( * * @return bool */ - public function isExtendEnabled(int $storeId = null): bool + public function isExtendEnabled(?int $storeId = null): bool { $result = false; From 07c94fea89db1b665586858a9bcdbf4a28921c2f Mon Sep 17 00:00:00 2001 From: JM <100705862+jm-extend@users.noreply.github.com> Date: Fri, 21 Nov 2025 11:12:10 -0600 Subject: [PATCH 2/2] Update Warranty.php added 2 additional checks for null parameters --- ViewModel/Warranty.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ViewModel/Warranty.php b/ViewModel/Warranty.php index f9e6b9ba..82059c33 100644 --- a/ViewModel/Warranty.php +++ b/ViewModel/Warranty.php @@ -493,7 +493,7 @@ public function isPostPurchaseLeadModalEnabled(): bool * @param $storeId * @return bool */ - public function isOrderOffersEnabled($storeId = null): bool + public function isOrderOffersEnabled(?string $storeId = null): bool { return $this->dataHelper->isOrderOffersEnabled($storeId); } @@ -666,7 +666,7 @@ public function getProductInfo($product) ]; } - public function getOrderIncrementId($orderId = null){ + public function getOrderIncrementId(string|int|null $orderId = null){ if ($orderId){ $order = $this->orderRepository->get($orderId); $incrementId = $order->getIncrementId();