Skip to content

Commit ec32818

Browse files
committed
MAGE-938 Fix types
1 parent 5ccd3e5 commit ec32818

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Service/Product/ReplicaManager.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ class ReplicaManager implements ReplicaManagerInterface
4343
public const ALGOLIA_SETTINGS_KEY_REPLICAS = 'replicas';
4444

4545
protected const _DEBUG = true;
46+
47+
// LOCAL CACHING VARIABLES
48+
/** @var array<string, string[]> */
4649
protected array $_algoliaReplicaConfig = [];
50+
51+
/** @var array<int, string[]> */
4752
protected array $_magentoReplicaPossibleConfig = [];
4853

4954
public function __construct(
@@ -89,15 +94,15 @@ protected function hasReplicaConfigurationChanged(int $storeId): bool
8994
/**
9095
* @param $primaryIndexName
9196
* @param bool $refreshCache
92-
* @return array<string, mixed>
97+
* @return string[]
9398
* @throws LocalizedException
9499
*/
95100
protected function getReplicaConfigurationFromAlgolia($primaryIndexName, bool $refreshCache = false): array
96101
{
97102
if ($refreshCache || !isset($this->_algoliaReplicaConfig[$primaryIndexName])) {
98103
try {
99104
$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)
101106
? $currentSettings[self::ALGOLIA_SETTINGS_KEY_REPLICAS]
102107
: [];
103108
} catch (\Exception $e) {
@@ -185,7 +190,7 @@ protected function getNonMagentoReplicaConfigurationFromAlgolia(string $primaryI
185190
*
186191
* @param int $storeId
187192
* @param bool $refreshCache
188-
* @return array
193+
* @return string[]
189194
* @throws LocalizedException
190195
* @throws NoSuchEntityException
191196
* @deprecated This method has been supplanted by the much simpler getMagentoReplicaSettings() method

Service/StoreNameFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class StoreNameFetcher
99
{
10-
/** @var string[] */
10+
/** @var array<int, string> */
1111
protected array $_storeNames = [];
1212

1313
public function __construct(

0 commit comments

Comments
 (0)