Skip to content

Commit f3473bb

Browse files
authored
Merge pull request #54 from ivanhrytsaim/13311-Magento248-Php84-Сompatibility
13311-Magento248-Php84-Сompatibility
2 parents f3b0dc4 + f4ea12a commit f3473bb

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

Api/ContainerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ interface ContainerInterface
1919
* @return array
2020
* @throws NoSuchEntityException
2121
*/
22-
public function generate(string $storeId = null): array;
22+
public function generate(?string $storeId = null): array;
2323
}

Block/AbstractDataLayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
Context $context,
3636
Config $config,
3737
array $data = [],
38-
SecureHtmlRendererInterface $mfSecureRenderer = null
38+
?SecureHtmlRendererInterface $mfSecureRenderer = null
3939
) {
4040
$this->config = $config;
4141
$this->mfSecureRenderer = $mfSecureRenderer ?: \Magento\Framework\App\ObjectManager::getInstance()

Model/AbstractDataLayer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public function __construct(
7878
Config $config,
7979
StoreManagerInterface $storeManager,
8080
CategoryRepositoryInterface $categoryRepository,
81-
RequestInterface $request = null,
82-
Registry $registry = null,
83-
Session $session = null,
84-
GroupRepository $groupRepository = null
81+
?RequestInterface $request = null,
82+
?Registry $registry = null,
83+
?Session $session = null,
84+
?GroupRepository $groupRepository = null
8585
) {
8686
$this->config = $config;
8787
$this->storeManager = $storeManager;

Model/Config.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function __construct(
9797
* @param string|null $storeId
9898
* @return bool
9999
*/
100-
public function isEnabled(string $storeId = null): bool
100+
public function isEnabled(?string $storeId = null): bool
101101
{
102102
return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId);
103103
}
@@ -108,7 +108,7 @@ public function isEnabled(string $storeId = null): bool
108108
* @param string|null $storeId
109109
* @return bool
110110
*/
111-
public function isWebContainerEnabled(string $storeId = null): bool
111+
public function isWebContainerEnabled(?string $storeId = null): bool
112112
{
113113
return (bool)$this->getConfig(self::XML_PATH_WEB_CONTAINER_ENABLED, $storeId);
114114
}
@@ -119,7 +119,7 @@ public function isWebContainerEnabled(string $storeId = null): bool
119119
* @param string|null $storeId
120120
* @return string
121121
*/
122-
public function getAccountId(string $storeId = null): string
122+
public function getAccountId(?string $storeId = null): string
123123
{
124124
return trim((string)$this->getConfig(self::XML_PATH_ACCOUNT_ID, $storeId));
125125
}
@@ -130,7 +130,7 @@ public function getAccountId(string $storeId = null): string
130130
* @param string|null $storeId
131131
* @return string
132132
*/
133-
public function getContainerId(string $storeId = null): string
133+
public function getContainerId(?string $storeId = null): string
134134
{
135135
return trim((string)$this->getConfig(self::XML_PATH_CONTAINER_ID, $storeId));
136136
}
@@ -139,7 +139,7 @@ public function getContainerId(string $storeId = null): string
139139
* @param string|null $storeId
140140
* @return string
141141
*/
142-
public function getPublicId(string $storeId = null): string
142+
public function getPublicId(?string $storeId = null): string
143143
{
144144
if ('use_public_id' === $this->getInstallGtm()) {
145145
return trim((string)$this->getConfig(self::XML_PATH_WEB_PUBLIC_ID, $storeId));
@@ -162,7 +162,7 @@ public function getPublicId(string $storeId = null): string
162162
* @param string|null $storeId
163163
* @return string
164164
*/
165-
public function getGtmScript(string $storeId = null): string
165+
public function getGtmScript(?string $storeId = null): string
166166
{
167167
return trim((string)$this->getConfig(self::XML_PATH_SCRIPT_CONTENT, $storeId));
168168
}
@@ -171,7 +171,7 @@ public function getGtmScript(string $storeId = null): string
171171
* @param string|null $storeId
172172
* @return string
173173
*/
174-
public function getGtmNoScript(string $storeId = null): string
174+
public function getGtmNoScript(?string $storeId = null): string
175175
{
176176
return trim((string)$this->getConfig(self::XML_PATH_NO_SCRIPT_CONTENT, $storeId));
177177
}
@@ -182,7 +182,7 @@ public function getGtmNoScript(string $storeId = null): string
182182
* @param string|null $storeId
183183
* @return bool
184184
*/
185-
public function isAnalyticsEnabled(string $storeId = null): bool
185+
public function isAnalyticsEnabled(?string $storeId = null): bool
186186
{
187187
return (bool)$this->getConfig(self::XML_PATH_ANALYTICS_ENABLE, $storeId);
188188
}
@@ -193,7 +193,7 @@ public function isAnalyticsEnabled(string $storeId = null): bool
193193
* @param string|null $storeId
194194
* @return string
195195
*/
196-
public function getMeasurementId(string $storeId = null): string
196+
public function getMeasurementId(?string $storeId = null): string
197197
{
198198
return trim((string)$this->getConfig(self::XML_PATH_ANALYTICS_MEASUREMENT_ID, $storeId));
199199
}
@@ -202,7 +202,7 @@ public function getMeasurementId(string $storeId = null): string
202202
* @param string|null $storeId
203203
* @return bool
204204
*/
205-
public function isPurchaseTaxEnabled(string $storeId = null): bool
205+
public function isPurchaseTaxEnabled(?string $storeId = null): bool
206206
{
207207
return (bool)$this->getConfig(self::XML_PATH_EVENTS_PURCHASE_TAX_ENABLED, $storeId);
208208
}
@@ -211,7 +211,7 @@ public function isPurchaseTaxEnabled(string $storeId = null): bool
211211
* @param string|null $storeId
212212
* @return bool
213213
*/
214-
public function isPurchaseShippingEnabled(string $storeId = null): bool
214+
public function isPurchaseShippingEnabled(?string $storeId = null): bool
215215
{
216216
return (bool)$this->getConfig(self::XML_PATH_EVENTS_PURCHASE_SHIPPING_ENABLED, $storeId);
217217
}
@@ -222,7 +222,7 @@ public function isPurchaseShippingEnabled(string $storeId = null): bool
222222
* @param string|null $storeId
223223
* @return string
224224
*/
225-
public function getProductAttribute(string $storeId = null): string
225+
public function getProductAttribute(?string $storeId = null): string
226226
{
227227
return trim((string)$this->getConfig(self::XML_PATH_ATTRIBUTES_PRODUCT, $storeId));
228228
}
@@ -233,7 +233,7 @@ public function getProductAttribute(string $storeId = null): string
233233
* @param string|null $storeId
234234
* @return string
235235
*/
236-
public function getBrandAttribute(string $storeId = null): string
236+
public function getBrandAttribute(?string $storeId = null): string
237237
{
238238
return trim((string)$this->getConfig(self::XML_PATH_ATTRIBUTES_BRAND, $storeId));
239239
}
@@ -244,7 +244,7 @@ public function getBrandAttribute(string $storeId = null): string
244244
* @param string|null $storeId
245245
* @return bool
246246
*/
247-
public function isProtectCustomerDataEnabled(string $storeId = null): bool
247+
public function isProtectCustomerDataEnabled(?string $storeId = null): bool
248248
{
249249
return (bool)$this->getConfig(self::XML_PATH_PROTECT_CUSTOMER_DATA, $storeId);
250250
}
@@ -255,7 +255,7 @@ public function isProtectCustomerDataEnabled(string $storeId = null): bool
255255
* @param string|null $storeId
256256
* @return bool
257257
*/
258-
public function isLoadBeforeConsent(string $storeId = null): bool
258+
public function isLoadBeforeConsent(?string $storeId = null): bool
259259
{
260260
return $this->getConfig(self::XML_PATH_LOAD_BEFORE_CONSENT, $storeId) ||
261261
!$this->isCookieRestrictionModeEnabled($storeId);
@@ -268,7 +268,7 @@ public function isLoadBeforeConsent(string $storeId = null): bool
268268
* @param string|null $storeId
269269
* @return bool
270270
*/
271-
public function isCookieRestrictionModeEnabled(string $storeId = null)
271+
public function isCookieRestrictionModeEnabled(?string $storeId = null)
272272
{
273273
return (bool)$this->getConfig(Custom::XML_PATH_WEB_COOKIE_RESTRICTION, $storeId);
274274
}
@@ -279,7 +279,7 @@ public function isCookieRestrictionModeEnabled(string $storeId = null)
279279
* @param string|null $storeId
280280
* @return bool
281281
*/
282-
public function isMfCookieConsentExtensionEnabled(string $storeId = null)
282+
public function isMfCookieConsentExtensionEnabled(?string $storeId = null)
283283
{
284284
return $this->moduleManager->isEnabled('Magefan_CookieConsent')
285285
&& $this->getConfig(self::XML_PATH_MF_COOKIE_CONSENT_EXTENSION_ENABLED, $storeId);
@@ -291,7 +291,7 @@ public function isMfCookieConsentExtensionEnabled(string $storeId = null)
291291
* @param string|null $storeId
292292
* @return string
293293
*/
294-
public function getCategoriesAttribute(string $storeId = null): string
294+
public function getCategoriesAttribute(?string $storeId = null): string
295295
{
296296
return trim((string)$this->getConfig(self::XML_PATH_ATTRIBUTES_CATEGORIES, $storeId));
297297
}
@@ -300,7 +300,7 @@ public function getCategoriesAttribute(string $storeId = null): string
300300
* @param string|null $storeId
301301
* @return int
302302
*/
303-
public function getInstallGtm(string $storeId = null): string
303+
public function getInstallGtm(?string $storeId = null): string
304304
{
305305
return trim((string)$this->getConfig(self::XML_PATH_INSTALL_GTM, $storeId));
306306
}
@@ -312,7 +312,7 @@ public function getInstallGtm(string $storeId = null): string
312312
* @param string|null $storeId
313313
* @return mixed
314314
*/
315-
public function getConfig(string $path, string $storeId = null)
315+
public function getConfig(string $path, ?string $storeId = null)
316316
{
317317
return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId);
318318
}
@@ -323,7 +323,7 @@ public function getConfig(string $path, string $storeId = null)
323323
* @param string|null $storeId
324324
* @return bool
325325
*/
326-
public function isSpeedOptimizationEnabled(string $storeId = null): bool
326+
public function isSpeedOptimizationEnabled(?string $storeId = null): bool
327327
{
328328
return (bool)$this->getConfig(self::XML_PATH_SPEED_OPTIMIZATION_ENABLED, $storeId);
329329
}
@@ -332,7 +332,7 @@ public function isSpeedOptimizationEnabled(string $storeId = null): bool
332332
* @param string|null $storeId
333333
* @return bool
334334
*/
335-
public function isThirdPartyGaEnabled(string $storeId = null): bool
335+
public function isThirdPartyGaEnabled(?string $storeId = null): bool
336336
{
337337
return (bool)$this->getConfig(self::XML_PATH_THIRD_PARTY_GA, $storeId);
338338
}

Model/WebContainer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
* @return array
5555
* @throws NoSuchEntityException
5656
*/
57-
public function generate(string $storeId = null): array
57+
public function generate(?string $storeId = null): array
5858
{
5959
$store = $this->storeManager->getStore($storeId);
6060
$timestamp = (string)$this->dateTime->timestamp();
@@ -192,7 +192,7 @@ private function generateTags(
192192
string $accountId,
193193
string $containerId,
194194
string $timestamp,
195-
string $storeId = null
195+
?string $storeId = null
196196
): array {
197197
return [
198198
[
@@ -300,7 +300,7 @@ private function generateVariable(
300300
string $accountId,
301301
string $containerId,
302302
string $timestamp,
303-
string $storeId = null
303+
?string $storeId = null
304304
): array {
305305
return [
306306
[

0 commit comments

Comments
 (0)