Skip to content

Commit 76ae6f6

Browse files
cammonromrahman3177
authored andcommitted
MAGE-866: commit cherry-picked from 864
1 parent 8aa0274 commit 76ae6f6

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

ViewModel/Adminhtml/Analytics/Overview.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Algolia\AlgoliaSearch\ViewModel\Adminhtml\BackendView;
88
use Magento\Framework\Exception\LocalizedException;
99
use Magento\Framework\Exception\NoSuchEntityException;
10+
use Magento\Framework\Locale\ResolverInterface;
1011
use Magento\Store\Api\Data\StoreInterface;
1112

1213
class Overview implements \Magento\Framework\View\Element\Block\ArgumentInterface
@@ -17,22 +18,14 @@ class Overview implements \Magento\Framework\View\Element\Block\ArgumentInterfac
1718

1819
public const DEFAULT_RETENTION_DAYS = 90;
1920

20-
/** @var BackendView */
21-
private $backendView;
22-
23-
/** @var AnalyticsHelper */
24-
private $analyticsHelper;
25-
26-
/** @var IndexEntityDataProvider */
27-
private $indexEntityDataProvider;
28-
2921
/** @var array */
3022
private $analyticsParams = [];
3123

3224
/**
3325
* @param BackendView $backendView
3426
* @param AnalyticsHelper $analyticsHelper
3527
* @param IndexEntityDataProvider $indexEntityDataProvider
28+
* @param ResolverInterface $localeResolver
3629
*/
3730
public function __construct(
3831
protected BackendView $backendView,
@@ -49,9 +42,13 @@ public function getBackendView()
4942
return $this->backendView;
5043
}
5144

52-
public function getTimeZone()
45+
/**
46+
* @return string
47+
* @throws NoSuchEntityException
48+
*/
49+
public function getTimeZone(): string
5350
{
54-
return $this->backendView->getDateTime()->getConfigTimezone(
51+
return (string) $this->backendView->getDateTime()->getConfigTimezone(
5552
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
5653
$this->getStore()->getId()
5754
);
@@ -76,7 +73,7 @@ public function getIndexName()
7673
*
7774
* @return array
7875
*/
79-
public function getAnalyticsParams($additional = [])
76+
public function getAnalyticsParams(array $additional = []): array
8077
{
8178
if (empty($this->analyticsParams)) {
8279
$params = ['index' => $this->getIndexName()];
@@ -332,7 +329,7 @@ public function getNoResultSearches()
332329
*
333330
* @return bool
334331
*/
335-
public function checkIsValidDateRange()
332+
public function checkIsValidDateRange(): bool
336333
{
337334
if ($formData = $this->getBackendView()->getBackendSession()->getAlgoliaAnalyticsFormData()) {
338335
if (!empty($formData['from'])) {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": ["MIT"],
66
"version": "3.13.2",
77
"require": {
8+
"php": "~8.1|~8.2",
89
"magento/framework": "~102.0|~103.0",
910
"algolia/algoliasearch-client-php": "3.3.2",
1011
"guzzlehttp/guzzle": "^6.3.3|^7.3.0",

0 commit comments

Comments
 (0)