7
7
use Algolia \AlgoliaSearch \ViewModel \Adminhtml \BackendView ;
8
8
use Magento \Framework \Exception \LocalizedException ;
9
9
use Magento \Framework \Exception \NoSuchEntityException ;
10
+ use Magento \Framework \Locale \ResolverInterface ;
10
11
use Magento \Store \Api \Data \StoreInterface ;
11
12
12
13
class Overview implements \Magento \Framework \View \Element \Block \ArgumentInterface
@@ -17,22 +18,14 @@ class Overview implements \Magento\Framework\View\Element\Block\ArgumentInterfac
17
18
18
19
public const DEFAULT_RETENTION_DAYS = 90 ;
19
20
20
- /** @var BackendView */
21
- private $ backendView ;
22
-
23
- /** @var AnalyticsHelper */
24
- private $ analyticsHelper ;
25
-
26
- /** @var IndexEntityDataProvider */
27
- private $ indexEntityDataProvider ;
28
-
29
21
/** @var array */
30
22
private $ analyticsParams = [];
31
23
32
24
/**
33
25
* @param BackendView $backendView
34
26
* @param AnalyticsHelper $analyticsHelper
35
27
* @param IndexEntityDataProvider $indexEntityDataProvider
28
+ * @param ResolverInterface $localeResolver
36
29
*/
37
30
public function __construct (
38
31
protected BackendView $ backendView ,
@@ -49,9 +42,13 @@ public function getBackendView()
49
42
return $ this ->backendView ;
50
43
}
51
44
52
- public function getTimeZone ()
45
+ /**
46
+ * @return string
47
+ * @throws NoSuchEntityException
48
+ */
49
+ public function getTimeZone (): string
53
50
{
54
- return $ this ->backendView ->getDateTime ()->getConfigTimezone (
51
+ return ( string ) $ this ->backendView ->getDateTime ()->getConfigTimezone (
55
52
\Magento \Store \Model \ScopeInterface::SCOPE_STORE ,
56
53
$ this ->getStore ()->getId ()
57
54
);
@@ -76,7 +73,7 @@ public function getIndexName()
76
73
*
77
74
* @return array
78
75
*/
79
- public function getAnalyticsParams ($ additional = [])
76
+ public function getAnalyticsParams (array $ additional = []): array
80
77
{
81
78
if (empty ($ this ->analyticsParams )) {
82
79
$ params = ['index ' => $ this ->getIndexName ()];
@@ -332,7 +329,7 @@ public function getNoResultSearches()
332
329
*
333
330
* @return bool
334
331
*/
335
- public function checkIsValidDateRange ()
332
+ public function checkIsValidDateRange (): bool
336
333
{
337
334
if ($ formData = $ this ->getBackendView ()->getBackendSession ()->getAlgoliaAnalyticsFormData ()) {
338
335
if (!empty ($ formData ['from ' ])) {
0 commit comments