@@ -43,7 +43,12 @@ class ReplicaManager implements ReplicaManagerInterface
43
43
public const ALGOLIA_SETTINGS_KEY_REPLICAS = 'replicas ' ;
44
44
45
45
protected const _DEBUG = true ;
46
+
47
+ // LOCAL CACHING VARIABLES
48
+ /** @var array<string, string[]> */
46
49
protected array $ _algoliaReplicaConfig = [];
50
+
51
+ /** @var array<int, string[]> */
47
52
protected array $ _magentoReplicaPossibleConfig = [];
48
53
49
54
public function __construct (
@@ -89,15 +94,15 @@ protected function hasReplicaConfigurationChanged(int $storeId): bool
89
94
/**
90
95
* @param $primaryIndexName
91
96
* @param bool $refreshCache
92
- * @return array< string, mixed>
97
+ * @return string[]
93
98
* @throws LocalizedException
94
99
*/
95
100
protected function getReplicaConfigurationFromAlgolia ($ primaryIndexName , bool $ refreshCache = false ): array
96
101
{
97
102
if ($ refreshCache || !isset ($ this ->_algoliaReplicaConfig [$ primaryIndexName ])) {
98
103
try {
99
104
$ currentSettings = $ this ->algoliaHelper ->getSettings ($ primaryIndexName );
100
- $ this ->_algoliaReplicaConfig [$ primaryIndexName ] = array_key_exists (' replicas ' , $ currentSettings )
105
+ $ this ->_algoliaReplicaConfig [$ primaryIndexName ] = array_key_exists (self :: ALGOLIA_SETTINGS_KEY_REPLICAS , $ currentSettings )
101
106
? $ currentSettings [self ::ALGOLIA_SETTINGS_KEY_REPLICAS ]
102
107
: [];
103
108
} catch (\Exception $ e ) {
@@ -185,7 +190,7 @@ protected function getNonMagentoReplicaConfigurationFromAlgolia(string $primaryI
185
190
*
186
191
* @param int $storeId
187
192
* @param bool $refreshCache
188
- * @return array
193
+ * @return string[]
189
194
* @throws LocalizedException
190
195
* @throws NoSuchEntityException
191
196
* @deprecated This method has been supplanted by the much simpler getMagentoReplicaSettings() method
0 commit comments