Skip to content

Commit 0206508

Browse files
authored
Merge pull request #151 from magebitcom/feature/LMM-101
LMM-101 Php 8.4 adjustments
2 parents be5e377 + 13a3722 commit 0206508

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

Block/Installment/Pricing/Render/DefaultPriceBox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public function __construct(
7777
InstallmentProductRepositoryInterface $productRepository,
7878
SearchCriteriaBuilderFactory $criteriaBuilderFactory,
7979
array $data = [],
80-
SalableResolverInterface $salableResolver = null,
81-
MinimalPriceCalculatorInterface $minimalPriceCalculator = null
80+
?SalableResolverInterface $salableResolver = null,
81+
?MinimalPriceCalculatorInterface $minimalPriceCalculator = null
8282
) {
8383
$this->productRepo = $productRepository;
8484
$this->searchCriteria = $criteriaBuilderFactory->create();

Console/Import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Import extends Command
2929
public function __construct(
3030
SyncInstallments $installments,
3131
AppState $appState,
32-
string $name = null
32+
?string $name = null
3333
) {
3434
$this->installments = $installments;
3535
$this->appState = $appState;

Console/RemoveExpiredPromotionsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RemoveExpiredPromotionsCommand extends Command
2525
public function __construct(
2626
AppState $appState,
2727
RemoveExpiredPromotions $removeExpiredPromotions,
28-
string $name = null
28+
?string $name = null
2929
) {
3030
$this->appState = $appState;
3131
$this->removeExpiredPromotions = $removeExpiredPromotions;

Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public function getLeanpayPromosVendorCode(): string
587587
return $this->getLeanpayPromosMFPName($storeId);
588588
}
589589

590-
public function getProductPromoCode(ProductInterface $product = null)
590+
public function getProductPromoCode(?ProductInterface $product = null)
591591
{
592592
if (!$product) {
593593
return '';

Model/Config/Backend/Cron.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function __construct(
3737
\Magento\Framework\App\Config\ScopeConfigInterface $config,
3838
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
3939
\Magento\Framework\App\Config\ValueFactory $configValueFactory,
40-
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
41-
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
40+
?\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
41+
?\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
4242
array $data = []
4343
) {
4444
$this->configWriter = $configWriter;

Model/InstallmentProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
InstallmentProductInterfaceFactory $modelFactory,
6262
SearchCriteriaBuilderFactory $criteriaBuilderFactory,
6363
InstallmentProductSearchResultsInterfaceFactory $searchResultsFactory,
64-
SearchCriteria $collectionProcessor = null
64+
?SearchCriteria $collectionProcessor = null
6565
) {
6666
$this->modelFactory = $modelFactory;
6767
$this->resourceModel = $resourceModel;

Model/InstallmentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
5353
ResourceModel\Installment\CollectionFactory $collectionFactory,
5454
InstallmentInterfaceFactory $modelFactory,
5555
InstallmentSearchResultsInterfaceFactory $searchResultsFactory,
56-
CollectionProcessorInterface $collectionProcessor = null
56+
?CollectionProcessorInterface $collectionProcessor = null
5757
) {
5858
$this->modelFactory = $modelFactory;
5959
$this->resourceModel = $resourceModel;

Model/Method/Leanpay.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ public function __construct(
168168
Session $checkoutSession,
169169
Request $request,
170170
OrderRepositoryInterface $orderRepository,
171-
AbstractResource $resource = null,
172-
AbstractDb $resourceCollection = null,
171+
?AbstractResource $resource = null,
172+
?AbstractDb $resourceCollection = null,
173173
array $data = [],
174-
DirectoryHelper $directory = null
174+
?DirectoryHelper $directory = null
175175
) {
176176
parent::__construct(
177177
$context,
@@ -204,7 +204,7 @@ public function __construct(
204204
* @return bool
205205
* @throws NoSuchEntityException|LocalizedException
206206
*/
207-
public function isAvailable(CartInterface $quote = null)
207+
public function isAvailable(?CartInterface $quote = null)
208208
{
209209
$isActive = parent::isAvailable($quote);
210210

@@ -277,7 +277,7 @@ public function initialize($paymentAction, $stateObject)
277277

278278
$state = Order::STATE_CANCELED;
279279

280-
if (!$leanpayTokenData['error']) {
280+
if (isset($leanpayTokenData['error']) && !$leanpayTokenData['error'] && isset($leanpayTokenData['token'])) {
281281
$state = Order::STATE_NEW;
282282
$this->checkoutSession->setToken($leanpayTokenData['token']);
283283
}

Model/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getLeanpayToken(array $additionalData = []): array
7474
$this->curl->post($this->helper->getTokenUrl(), $jsonData);
7575
$response = json_decode($this->curl->getBody(), true);
7676

77-
$response = array_filter($response, static function($var){return $var !== null;} );
77+
$response = is_array($response) ? array_filter($response, static function($var){return $var !== null;}) : [];
7878

7979
return array_merge($response, [
8080
'error' => false

Plugin/Block/Product/ProductsListPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function aroundGetProductPriceHtml(
2828
ProductsList $subject,
2929
callable $proceed,
3030
Product $product,
31-
$priceType = null,
31+
?string $priceType = null,
3232
$renderZone = Render::ZONE_ITEM_LIST,
3333
array $arguments = []
3434
) {

0 commit comments

Comments
 (0)