diff --git a/Controller/Ajax/Analytics.php b/Controller/Ajax/Analytics.php index ea699614..344380fb 100644 --- a/Controller/Ajax/Analytics.php +++ b/Controller/Ajax/Analytics.php @@ -38,7 +38,7 @@ public function __construct( /** * @return ResponseInterface|Json|ResultInterface */ - public function execute() + public function execute(): ResponseInterface|Json|ResultInterface { $result = $this->resultJsonFactory->create(); if ($this->config->isAnalyticsEnabled()) { diff --git a/Model/Client/Request.php b/Model/Client/Request.php index 901f06fa..91c3c940 100644 --- a/Model/Client/Request.php +++ b/Model/Client/Request.php @@ -330,7 +330,7 @@ public function setProfileKey(string $profileKey) /** * @return string|null */ - public function setParameterArray(string $parameter, array $value) + public function setParameterArray(string $parameter, array $value): Request { $this->parameters[$parameter] = $value; return $this; @@ -339,7 +339,7 @@ public function setParameterArray(string $parameter, array $value) /** * @return string|null */ - public function isPostRequest() + public function isPostRequest(): bool { return false; } diff --git a/Model/Client/Request/AnalyticsRequest.php b/Model/Client/Request/AnalyticsRequest.php index 10abb1b7..71716eb3 100644 --- a/Model/Client/Request/AnalyticsRequest.php +++ b/Model/Client/Request/AnalyticsRequest.php @@ -24,7 +24,7 @@ class AnalyticsRequest extends Request /** * @return string */ - public function isPostRequest() + public function isPostRequest(): bool { return true; } @@ -32,7 +32,7 @@ public function isPostRequest() /** * @return string */ - public function getApiurl() + public function getApiurl(): string { return $this->apiUrl; } @@ -40,7 +40,7 @@ public function getApiurl() /** * @return void */ - public function setProfileKey(string $profileKey) + public function setProfileKey(string $profileKey): void { $this->setParameter('ProfileKey', $profileKey); } @@ -48,7 +48,7 @@ public function setProfileKey(string $profileKey) /** * @return void */ - public function setPath($path) + public function setPath($path): void { $this->path = $path; } @@ -56,7 +56,7 @@ public function setPath($path) /** * @return string */ - public function getProfileKey() + public function getProfileKey(): string { $profileKey = $this->getCookie($this->config->getPersonalMerchandisingCookieName()); if (!$profileKey) { diff --git a/Model/Client/Request/PurchaseRequest.php b/Model/Client/Request/PurchaseRequest.php index 094ee3aa..1bf62160 100644 --- a/Model/Client/Request/PurchaseRequest.php +++ b/Model/Client/Request/PurchaseRequest.php @@ -29,7 +29,7 @@ class PurchaseRequest extends Request /** * @return true */ - public function isPostRequest() + public function isPostRequest(): bool { return true; } @@ -37,7 +37,7 @@ public function isPostRequest() /** * @return mixed|string */ - public function getApiurl() + public function getApiurl(): string { return $this->apiUrl; } @@ -47,7 +47,7 @@ public function getApiurl() * * @return void */ - public function setProfileKey(string $profileKey) + public function setProfileKey(string $profileKey): void { $this->setParameter('ProfileKey', $profileKey); } diff --git a/Model/PersonalMerchandisingConfig.php b/Model/PersonalMerchandisingConfig.php index 066859cf..6eedfe17 100644 --- a/Model/PersonalMerchandisingConfig.php +++ b/Model/PersonalMerchandisingConfig.php @@ -31,7 +31,7 @@ public function __construct( * @param Store|null $store * @return bool */ - public function isAnalyticsEnabled(Store $store = null) + public function isAnalyticsEnabled(Store $store = null): bool { return (bool)$this->getStoreConfig('tweakwise/personal_merchandising/analytics_enabled', $store); } @@ -39,7 +39,7 @@ public function isAnalyticsEnabled(Store $store = null) /** * @return string|null */ - public function getProfileKey() + public function getProfileKey(): ?string { $profileKey = $this->cookieManager->getCookie( $this->getPersonalMerchandisingCookieName(), @@ -61,9 +61,9 @@ public function getProfileKey() } /** - * @return string + * @return CookieMetadataInterface */ - private function getCookieMetadata() + private function getCookieMetadata(): CookieMetadataInterface { return $this->cookieMetadataFactory ->createPublicCookieMetadata() @@ -75,7 +75,7 @@ private function getCookieMetadata() /** * @return string */ - private function generateProfileKey() + private function generateProfileKey(): string { return uniqid('', true); } diff --git a/Observer/TweakwiseCheckout.php b/Observer/TweakwiseCheckout.php index 2be13a8e..82b4863c 100644 --- a/Observer/TweakwiseCheckout.php +++ b/Observer/TweakwiseCheckout.php @@ -43,9 +43,9 @@ public function __construct( * @return void * @throws \Magento\Framework\Exception\NoSuchEntityException */ - public function execute(Observer $observer) + public function execute(Observer $observer): void { - if ($this->config->isAnalyticsEnabled('tweakwise/personal_merchandising/analytics_enabled')) { + if ($this->config->isAnalyticsEnabled()) { $order = $observer->getEvent()->getOrder(); // Get the order items $items = $order->getAllItems(); @@ -60,7 +60,7 @@ public function execute(Observer $observer) * @return void * @throws \Magento\Framework\Exception\NoSuchEntityException */ - private function sendCheckout($items) + private function sendCheckout($items): void { $storeId = (int)$this->storeManager->getStore()->getId(); $profileKey = $this->config->getProfileKey();