Skip to content

Commit dfa35b1

Browse files
committed
adds explicit nullable types to missing arguments for PHP 8.4 compatibility
1 parent b6622e2 commit dfa35b1

33 files changed

+72
-72
lines changed

Helper/AlgoliaHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public function copyQueryRules(string $fromIndexName, string $toIndexName, ?int
297297
*
298298
* @throws AlgoliaException|NoSuchEntityException
299299
*/
300-
public function searchRules(string $indexName, array $searchRulesParams = null, ?int $storeId = null)
300+
public function searchRules(string $indexName, ?array $searchRulesParams = null, ?int $storeId = null)
301301
{
302302
$indexOptions = $this->indexOptionsBuilder->buildWithEnforcedIndex($indexName, $storeId);
303303

Helper/Configuration/PersonalizationHelper.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
*
5252
* @return bool
5353
*/
54-
public function isPersoEnabled(int $storeId = null): bool
54+
public function isPersoEnabled(?int $storeId = null): bool
5555
{
5656
return $this->configInterface->isSetFlag(self::IS_PERSO_ENABLED, ScopeInterface::SCOPE_STORE, $storeId);
5757
}
@@ -61,7 +61,7 @@ public function isPersoEnabled(int $storeId = null): bool
6161
*
6262
* @return void
6363
*/
64-
public function disablePerso(int $storeId = null): void
64+
public function disablePerso(?int $storeId = null): void
6565
{
6666
$this->configResourceInterface->saveConfig(self::IS_PERSO_ENABLED, 0, 'default', 0);
6767
}
@@ -71,7 +71,7 @@ public function disablePerso(int $storeId = null): void
7171
*
7272
* @return bool
7373
*/
74-
public function isViewProductTracked(int $storeId = null): bool
74+
public function isViewProductTracked(?int $storeId = null): bool
7575
{
7676
return $this->configInterface->isSetFlag(self::VIEW_PRODUCT, ScopeInterface::SCOPE_STORE, $storeId);
7777
}
@@ -81,7 +81,7 @@ public function isViewProductTracked(int $storeId = null): bool
8181
*
8282
* @return bool
8383
*/
84-
public function isProductClickedTracked(int $storeId = null): bool
84+
public function isProductClickedTracked(?int $storeId = null): bool
8585
{
8686
return $this->configInterface->isSetFlag(self::PRODUCT_CLICKED, ScopeInterface::SCOPE_STORE, $storeId);
8787
}
@@ -91,7 +91,7 @@ public function isProductClickedTracked(int $storeId = null): bool
9191
*
9292
* @return string
9393
*/
94-
public function getProductClickedSelector(int $storeId = null): string
94+
public function getProductClickedSelector(?int $storeId = null): string
9595
{
9696
return $this->configInterface->getValue(self::PRODUCT_CLICKED_SELECTOR, ScopeInterface::SCOPE_STORE, $storeId);
9797
}
@@ -101,7 +101,7 @@ public function getProductClickedSelector(int $storeId = null): string
101101
*
102102
* @return bool
103103
*/
104-
public function isFilterClickedTracked(int $storeId = null): bool
104+
public function isFilterClickedTracked(?int $storeId = null): bool
105105
{
106106
return $this->configInterface->isSetFlag(self::FILTER_CLICKED, ScopeInterface::SCOPE_STORE, $storeId);
107107
}
@@ -111,7 +111,7 @@ public function isFilterClickedTracked(int $storeId = null): bool
111111
*
112112
* @return bool
113113
*/
114-
public function isWishlistAddTracked(int $storeId = null): bool
114+
public function isWishlistAddTracked(?int $storeId = null): bool
115115
{
116116
return $this->configInterface->isSetFlag(self::WISHLIST_ADD, ScopeInterface::SCOPE_STORE, $storeId);
117117
}
@@ -121,7 +121,7 @@ public function isWishlistAddTracked(int $storeId = null): bool
121121
*
122122
* @return string
123123
*/
124-
public function getWishlistAddSelector(int $storeId = null): string
124+
public function getWishlistAddSelector(?int $storeId = null): string
125125
{
126126
return $this->configInterface->getValue(self::WISHLIST_ADD_SELECTOR, ScopeInterface::SCOPE_STORE, $storeId);
127127
}
@@ -131,7 +131,7 @@ public function getWishlistAddSelector(int $storeId = null): string
131131
*
132132
* @return bool
133133
*/
134-
public function isProductRecommendedTracked(int $storeId = null): bool
134+
public function isProductRecommendedTracked(?int $storeId = null): bool
135135
{
136136
return $this->configInterface->isSetFlag(self::PRODUCT_RECOMMENDED, ScopeInterface::SCOPE_STORE, $storeId);
137137
}
@@ -141,7 +141,7 @@ public function isProductRecommendedTracked(int $storeId = null): bool
141141
*
142142
* @return string
143143
*/
144-
public function getProductRecommendedSelector(int $storeId = null): string
144+
public function getProductRecommendedSelector(?int $storeId = null): string
145145
{
146146
return $this->configInterface->getValue(self::PRODUCT_RECOMMENDED_SELECTOR, ScopeInterface::SCOPE_STORE, $storeId);
147147
}
@@ -151,7 +151,7 @@ public function getProductRecommendedSelector(int $storeId = null): string
151151
*
152152
* @return bool
153153
*/
154-
public function isCartAddTracked(int $storeId = null): bool
154+
public function isCartAddTracked(?int $storeId = null): bool
155155
{
156156
return $this->configInterface->isSetFlag(self::CART_ADD, ScopeInterface::SCOPE_STORE, $storeId);
157157
}
@@ -161,7 +161,7 @@ public function isCartAddTracked(int $storeId = null): bool
161161
*
162162
* @return string
163163
*/
164-
public function getCartAddSelector(int $storeId = null): string
164+
public function getCartAddSelector(?int $storeId = null): string
165165
{
166166
return $this->configInterface->getValue(self::CART_ADD_SELECTOR, ScopeInterface::SCOPE_STORE, $storeId);
167167
}
@@ -171,7 +171,7 @@ public function getCartAddSelector(int $storeId = null): string
171171
*
172172
* @return bool
173173
*/
174-
public function isOrderPlacedTracked(int $storeId = null): bool
174+
public function isOrderPlacedTracked(?int $storeId = null): bool
175175
{
176176
return $this->configInterface->isSetFlag(self::ORDER_PLACED, ScopeInterface::SCOPE_STORE, $storeId);
177177
}

Helper/Data.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function rebuildStoreAdditionalSectionsIndex(int $storeId): void
5959
* @deprecated
6060
* Use Algolia\AlgoliaSearch\Service\Page\IndexBuilder::buildIndexFull() instead
6161
*/
62-
public function rebuildStorePageIndex($storeId, array $pageIds = null): void
62+
public function rebuildStorePageIndex($storeId, ?array $pageIds = null): void
6363
{
6464
$this->pageIndexBuilder->buildIndexFull($storeId, ['entityIds' => $pageIds]);
6565
}
@@ -203,7 +203,7 @@ public function isIndexingEnabled($storeId = null): bool
203203
* @return string
204204
* @throws NoSuchEntityException
205205
*/
206-
public function getIndexName(string $indexSuffix, int $storeId = null, bool $tmp = false): string
206+
public function getIndexName(string $indexSuffix, ?int $storeId = null, bool $tmp = false): string
207207
{
208208
return $this->indexNameFetcher->getIndexName($indexSuffix, $storeId, $tmp);
209209
}
@@ -213,7 +213,7 @@ public function getIndexName(string $indexSuffix, int $storeId = null, bool $tmp
213213
* @return string
214214
* @throws NoSuchEntityException
215215
*/
216-
public function getBaseIndexName(int $storeId = null): string
216+
public function getBaseIndexName(?int $storeId = null): string
217217
{
218218
return $this->indexNameFetcher->getBaseIndexName($storeId);
219219
}
@@ -237,7 +237,7 @@ public function getIndexDataByStoreIds(): array
237237
* @return array
238238
* @throws NoSuchEntityException
239239
*/
240-
protected function buildIndexData(StoreInterface $store = null): array
240+
protected function buildIndexData(?StoreInterface $store = null): array
241241
{
242242
$storeId = !is_null($store) ? $store->getStoreId() : null;
243243
$currencyCode = !is_null($store) ?

Helper/Entity/PageHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getIndexSettings(?int $storeId = null): array
4848
return $indexSettings;
4949
}
5050

51-
public function getPages($storeId, array $pageIds = null)
51+
public function getPages($storeId, ?array $pageIds = null)
5252
{
5353
$magentoPages = $this->pageCollectionFactory->create()
5454
->addStoreFilter($storeId)

Helper/Entity/ProductHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ protected function getAttributesForFaceting($storeId)
577577
* @return void
578578
* @throws AlgoliaException
579579
*/
580-
protected function setFacetsQueryRules(string $indexName, int $storeId = null)
580+
protected function setFacetsQueryRules(string $indexName, ?int $storeId = null)
581581
{
582582
$this->clearFacetsQueryRules($indexName, $storeId);
583583

@@ -623,7 +623,7 @@ protected function setFacetsQueryRules(string $indexName, int $storeId = null)
623623
* @return void
624624
* @throws AlgoliaException
625625
*/
626-
protected function clearFacetsQueryRules($indexName, int $storeId = null): void
626+
protected function clearFacetsQueryRules($indexName, ?int $storeId = null): void
627627
{
628628
try {
629629
$hitsPerPage = 100;

Helper/InsightsHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function setAuthenticatedUserToken(Customer $customer): string|null
162162
* @param int|null $storeId
163163
* @return bool
164164
*/
165-
public function isInsightsEnabled(int $storeId = null): bool
165+
public function isInsightsEnabled(?int $storeId = null): bool
166166
{
167167
return $this->configHelper->isClickConversionAnalyticsEnabled($storeId)
168168
|| $this->personalizationHelper->isPersoEnabled($storeId);
@@ -174,7 +174,7 @@ public function isInsightsEnabled(int $storeId = null): bool
174174
*
175175
* @return bool
176176
*/
177-
public function isOrderPlacedTracked(int $storeId = null): bool
177+
public function isOrderPlacedTracked(?int $storeId = null): bool
178178
{
179179
return $this->personalizationHelper->isPersoEnabled($storeId)
180180
&& $this->personalizationHelper->isOrderPlacedTracked($storeId)
@@ -188,7 +188,7 @@ public function isOrderPlacedTracked(int $storeId = null): bool
188188
* @param int|null $storeId
189189
* @return bool
190190
*/
191-
public function isConversionTrackedPlaceOrder(int $storeId = null): bool
191+
public function isConversionTrackedPlaceOrder(?int $storeId = null): bool
192192
{
193193
return $this->configHelper->isClickConversionAnalyticsEnabled($storeId)
194194
&& in_array($this->configHelper->getConversionAnalyticsMode($storeId),
@@ -206,7 +206,7 @@ public function isConversionTrackedPlaceOrder(int $storeId = null): bool
206206
*
207207
* @return bool
208208
*/
209-
public function isAddedToCartTracked(int $storeId = null): bool
209+
public function isAddedToCartTracked(?int $storeId = null): bool
210210
{
211211
return $this->personalizationHelper->isPersoEnabled($storeId)
212212
&& $this->personalizationHelper->isCartAddTracked($storeId)
@@ -220,7 +220,7 @@ public function isAddedToCartTracked(int $storeId = null): bool
220220
* @param int|null $storeId
221221
* @return bool
222222
*/
223-
public function isConversionTrackedAddToCart(int $storeId = null): bool
223+
public function isConversionTrackedAddToCart(?int $storeId = null): bool
224224
{
225225
return $this->configHelper->isClickConversionAnalyticsEnabled($storeId)
226226
&& in_array($this->configHelper->getConversionAnalyticsMode($storeId),

Helper/MerchandisingHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public function saveQueryRule(int $storeId,
4141
int $entityId,
4242
array $rawPositions,
4343
string $entityType,
44-
string $query = null,
45-
string $banner = null): void
44+
?string $query = null,
45+
?string $banner = null): void
4646
{
4747
if ($this->coreHelper->isIndexingEnabled($storeId) === false) {
4848
return;

Model/Backend/EnableCustomerGroups.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __construct(
2222
TypeListInterface $cacheTypeList,
2323
protected ReplicaState $replicaState,
2424
protected ConfigChecker $configChecker,
25-
AbstractResource $resource = null,
26-
AbstractDb $resourceCollection = null,
25+
?AbstractResource $resource = null,
26+
?AbstractDb $resourceCollection = null,
2727
array $data = []
2828
)
2929
{

Model/Backend/Sorts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public function __construct(
2424
TypeListInterface $cacheTypeList,
2525
protected ReplicaState $replicaState,
2626
protected ConfigChecker $configChecker,
27-
AbstractResource $resource = null,
28-
AbstractDb $resourceCollection = null,
27+
?AbstractResource $resource = null,
28+
?AbstractDb $resourceCollection = null,
2929
array $data = [],
30-
Json $serializer = null
30+
?Json $serializer = null
3131
)
3232
{
3333
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);

Model/Indexer/ProductObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function afterDelete(ProductResource $productResource, ProductResource $r
6969
*
7070
* @return Action
7171
*/
72-
public function afterUpdateAttributes(Action $subject, Action $result = null, $productIds)
72+
public function afterUpdateAttributes(Action $subject, ?Action $result = null, $productIds)
7373
{
7474
if (!$this->indexer->isScheduled()) {
7575
$this->indexer->reindexList(array_unique($productIds));
@@ -85,7 +85,7 @@ public function afterUpdateAttributes(Action $subject, Action $result = null, $p
8585
*
8686
* @return mixed
8787
*/
88-
public function afterUpdateWebsites(Action $subject, Action $result = null, array $productIds)
88+
public function afterUpdateWebsites(Action $subject, ?Action $result = null, array $productIds)
8989
{
9090
if (!$this->indexer->isScheduled()) {
9191
$this->indexer->reindexList(array_unique($productIds));

0 commit comments

Comments
 (0)