Skip to content

Commit 2caf3d2

Browse files
aarondeane-extendmagento-bot
andauthored
feat: [MINT-4816] PHP 8.4 compatibility (#218)
* update composer.json and workflow for 8.4 compatibility * update nullable property definition and character escaping for compatibility * add and update test files for changes * update workflow versions * auto-changelog * auto-changelog * auto-changelog * fix: [MINT-4816] fix unit test issues for PHP 8.4 compatibility tests * remove unused import statements * auto-changelog * verify proper return type * ignore cursor related files * remove WIP and cursor related files * remove compatibility test file * auto-changelog * add annotation * auto-changelog * downrev magento version for github action compatibility * auto-changelog * downrev again for test workflow file * auto-changelog * auto-changelog * auto-changelog * auto-changelog * auto-changelog * add checks with null parameters * additional instances of implicitly nullable parameters * auto-changelog * additional implicit null param * auto-changelog * frontend class optional params * another one like DJ Khalid * auto-changelog * update mock * auto-changelog * another test fix * auto-changelog * additional optional parameters in test scaffold * auto-changelog * auto-changelog --------- Co-authored-by: magento-bot <[email protected]>
1 parent 0e29779 commit 2caf3d2

14 files changed

+367
-83
lines changed

Api/ProductProtectionInterface.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ public function getListPrice(): ?string;
164164
* @throws LocalizedException
165165
*/
166166
public function upsertSession(
167-
int $quantity = null,
168-
string $cartItemId = null,
169-
string $productId = null,
170-
string $planId = null,
171-
int $price = null,
172-
int $term = null,
173-
string $coverageType = null,
174-
string $leadToken = null,
175-
string $listPrice = null,
176-
string $orderOfferPlanId = null
167+
?int $quantity = null,
168+
?string $cartItemId = null,
169+
?string $productId = null,
170+
?string $planId = null,
171+
?int $price = null,
172+
?int $term = null,
173+
?string $coverageType = null,
174+
?string $leadToken = null,
175+
?string $listPrice = null,
176+
?string $orderOfferPlanId = null
177177
): void;
178178

179179
/**
@@ -195,16 +195,16 @@ public function upsertSession(
195195
* @throws LocalizedException
196196
*/
197197
public function upsertCartId(
198-
int $quantity = null,
199-
string $cartId = null,
200-
string $cartItemId = null,
201-
string $productId = null,
202-
string $planId = null,
203-
int $price = null,
204-
int $term = null,
205-
string $coverageType = null,
206-
string $leadToken = null,
207-
string $listPrice = null,
208-
string $orderOfferPlanId = null
198+
?int $quantity = null,
199+
?string $cartId = null,
200+
?string $cartItemId = null,
201+
?string $productId = null,
202+
?string $planId = null,
203+
?int $price = null,
204+
?int $term = null,
205+
?string $coverageType = null,
206+
?string $leadToken = null,
207+
?string $listPrice = null,
208+
?string $orderOfferPlanId = null
209209
): void;
210210
}

Api/ShippingProtectionTotalRepositoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function save(int $entityId, int $entityTypeId, string $spQuoteId, float
6565
* @throws LocalizedException
6666
* @throws NoSuchEntityException
6767
*/
68-
public function saveBySdk(string $spQuoteId, float $price, string $currency, float $basePrice = null, string $baseCurrency = null, float $spTax = null, string $offerType = null): void;
68+
public function saveBySdk(string $spQuoteId, float $price, string $currency, ?float $basePrice = null, ?string $baseCurrency = null, ?float $spTax = null, ?string $offerType = null): void;
6969

7070
/**
7171
* Delete Shipping Protection total by record ID
@@ -118,5 +118,5 @@ public function saveAndResaturateExtensionAttribute(ShippingProtectionInterface
118118
* @throws LocalizedException
119119
* @throws NoSuchEntityException
120120
*/
121-
public function saveByApi(string $cartId, string $spQuoteId, float $price, string $currency, float $basePrice = null, string $baseCurrency = null, float $spTax = null): void;
121+
public function saveByApi(string $cartId, string $spQuoteId, float $price, string $currency, ?float $basePrice = null, ?string $baseCurrency = null, ?float $spTax = null): void;
122122
}

Model/Config/Backend/EnableProductProtection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public function __construct(
2525
AttributeSetInstaller $attributeSetInstaller,
2626
ProductInstaller $productInstaller,
2727
WriterInterface $writer,
28-
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
29-
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null
28+
?\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
29+
?\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null
3030
) {
3131
parent::__construct(
3232
$context,

Model/Config/Backend/V1enable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __construct(
2222
\Magento\Framework\App\Config\ScopeConfigInterface $config,
2323
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
2424
WriterInterface $writer,
25-
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
26-
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null
25+
?\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
26+
?\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null
2727
) {
2828
parent::__construct(
2929
$context,

Model/Config/Frontend/EnableCartBalancing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
\Magento\Framework\Module\Manager $manager,
3434
StoreManagerInterface $storeManager,
3535
array $data = [],
36-
SecureHtmlRenderer $secureRenderer = null
36+
?SecureHtmlRenderer $secureRenderer = null
3737
) {
3838
parent::__construct($context, $data, $secureRenderer);
3939
$this->scopeConfig = $scopeConfig;

Model/Config/Frontend/EnableProductProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
\Magento\Framework\Module\Manager $manager,
3434
StoreManagerInterface $storeManager,
3535
array $data = [],
36-
SecureHtmlRenderer $secureRenderer = null
36+
?SecureHtmlRenderer $secureRenderer = null
3737
) {
3838
parent::__construct($context, $data, $secureRenderer);
3939
$this->scopeConfig = $scopeConfig;

Model/Config/Frontend/EnableShippingProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
\Magento\Framework\Module\Manager $manager,
3434
StoreManagerInterface $storeManager,
3535
array $data = [],
36-
SecureHtmlRenderer $secureRenderer = null
36+
?SecureHtmlRenderer $secureRenderer = null
3737
) {
3838
parent::__construct($context, $data, $secureRenderer);
3939
$this->scopeConfig = $scopeConfig;

Model/ProductProtection.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,17 @@ public function getListPrice(): ?string
305305
* @throws LocalizedException
306306
*/
307307
private function upsert(
308-
int $quantity = null,
309-
string $cartId = null,
310-
string $cartItemId = null,
311-
string $productId = null,
312-
string $planId = null,
313-
int $price = null,
314-
int $term = null,
315-
string $coverageType = null,
316-
string $leadToken = null,
317-
string $listPrice = null,
318-
string $orderOfferPlanId = null
308+
?int $quantity = null,
309+
?string $cartId = null,
310+
?string $cartItemId = null,
311+
?string $productId = null,
312+
?string $planId = null,
313+
?int $price = null,
314+
?int $term = null,
315+
?string $coverageType = null,
316+
?string $leadToken = null,
317+
?string $listPrice = null,
318+
?string $orderOfferPlanId = null
319319
): void {
320320
try {
321321
if ($price === 0) {
@@ -485,16 +485,16 @@ private function upsert(
485485
* @throws LocalizedException
486486
*/
487487
public function upsertSession(
488-
int $quantity = null,
489-
string $cartItemId = null,
490-
string $productId = null,
491-
string $planId = null,
492-
int $price = null,
493-
int $term = null,
494-
string $coverageType = null,
495-
string $leadToken = null,
496-
string $listPrice = null,
497-
string $orderOfferPlanId = null
488+
?int $quantity = null,
489+
?string $cartItemId = null,
490+
?string $productId = null,
491+
?string $planId = null,
492+
?int $price = null,
493+
?int $term = null,
494+
?string $coverageType = null,
495+
?string $leadToken = null,
496+
?string $listPrice = null,
497+
?string $orderOfferPlanId = null
498498
): void {
499499
$this->upsert(
500500
$quantity,
@@ -530,17 +530,17 @@ public function upsertSession(
530530
* @throws LocalizedException
531531
*/
532532
public function upsertCartId(
533-
int $quantity = null,
534-
string $cartId = null,
535-
string $cartItemId = null,
536-
string $productId = null,
537-
string $planId = null,
538-
int $price = null,
539-
int $term = null,
540-
string $coverageType = null,
541-
string $leadToken = null,
542-
string $listPrice = null,
543-
string $orderOfferPlanId = null
533+
?int $quantity = null,
534+
?string $cartId = null,
535+
?string $cartItemId = null,
536+
?string $productId = null,
537+
?string $planId = null,
538+
?int $price = null,
539+
?int $term = null,
540+
?string $coverageType = null,
541+
?string $leadToken = null,
542+
?string $listPrice = null,
543+
?string $orderOfferPlanId = null
544544
): void {
545545
$this->upsert(
546546
$quantity,

Model/ShippingProtectionTotalRepository.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ public function saveBySdk(
274274
string $spQuoteId,
275275
float $price,
276276
string $currency,
277-
float $basePrice = null,
278-
string $baseCurrency = null,
279-
float $spTax = null,
280-
string $offerType = null
277+
?float $basePrice = null,
278+
?string $baseCurrency = null,
279+
?float $spTax = null,
280+
?string $offerType = null
281281
): void {
282282
if ($offerType === 'SAFE_PACKAGE') {
283283
$price = 0.0;

Service/Api/AccessTokenBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function getAccessToken(int $expOffset = 60): string
141141
*
142142
* @return array{clientId: string|null, clientSecret: string|null, accessToken: string|null}
143143
*/
144-
public function getExtendOAuthClientData(int $integrationId = null): array
144+
public function getExtendOAuthClientData(?int $integrationId = null): array
145145
{
146146

147147
if (!$integrationId) {

0 commit comments

Comments
 (0)