@@ -50,53 +50,44 @@ class AnalyticsHelper
50
50
*/
51
51
private $ analyticsConfig ;
52
52
53
- /**
54
- * Can be changed through DI
55
- *
56
- * @var string
57
- */
58
- private $ region ;
59
-
60
53
/**
61
54
* @param AlgoliaHelper $algoliaHelper
62
55
* @param ConfigHelper $configHelper
63
56
* @param IndexEntityDataProvider $entityHelper
64
57
* @param Logger $logger
65
- * @param string $region
66
58
*/
67
59
public function __construct (
68
60
AlgoliaHelper $ algoliaHelper ,
69
61
ConfigHelper $ configHelper ,
70
62
IndexEntityDataProvider $ entityHelper ,
71
- Logger $ logger ,
72
- string $ region = 'us '
63
+ Logger $ logger
73
64
) {
74
65
$ this ->algoliaHelper = $ algoliaHelper ;
75
66
$ this ->configHelper = $ configHelper ;
76
67
77
68
$ this ->entityHelper = $ entityHelper ;
78
69
79
70
$ this ->logger = $ logger ;
80
- $ this ->region = $ region ;
81
71
}
82
72
83
73
private function setupAnalyticsClient ()
84
74
{
85
75
if ($ this ->analyticsClient ) {
86
76
return ;
87
77
}
88
-
89
- $ this ->region = $ this ->configHelper ->getAnalyticsRegion ();
78
+
79
+ $ region = $ this ->configHelper ->getAnalyticsRegion ();
80
+
90
81
$ this ->analyticsClient = AnalyticsClient::create (
91
82
$ this ->configHelper ->getApplicationID (),
92
83
$ this ->configHelper ->getAPIKey (),
93
- $ this -> region
84
+ $ region
94
85
);
95
86
96
87
$ this ->analyticsConfig = AnalyticsConfig::create (
97
88
$ this ->configHelper ->getApplicationID (),
98
89
$ this ->configHelper ->getAPIKey (),
99
- $ this -> region
90
+ $ region
100
91
);
101
92
}
102
93
0 commit comments