Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianaromagnoli committed Nov 11, 2024
1 parent 854f76e commit 9a6d037
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions src/Service/ElasticSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,33 @@ public function indexExists(string $indexName): Amp\Promise
});
}

/**
* @param array<array-key, mixed>|null $indexName
*/
public function setElasticSearchIndex(string $indexName): Amp\Promise
{
return $this->client->createIndex($indexName);
}


/**
* @param string $indexName
* @param array<string, mixed> $updateSettingsBody
*/
public function setElasticSearchIndexSettings(string $indexName, array $updateSettingsBody = null): Amp\Promise
{
return $this->client->updateIndexSettings($indexName, $updateSettingsBody);
}


/**
* @param string $indexName
* @param array<string, mixed> $updateMappingBody
*/
public function setElasticSearchIndexMapping(string $indexName, array $updateMappingBody = null): Amp\Promise
{
return $this->client->updateMappings($indexName, $updateMappingBody);
}

/**
* @param string $indexName
* @param array<string, mixed> $aliasBody
*/
public function setElasticSearchIndexAlias(string $indexName, string $aliasName, array $aliasBody = null): Amp\Promise
{
return $this->client->createOrUpdateAlias($indexName, $aliasName, $aliasBody);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/QueueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function boot(): Promise
);
}

if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody()) {
if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody() !== null) {
$elasticSearchIndexUpdateAliases = $this->flowConfig->getElasticSearchIndexUpdateAliasesBody();
foreach ($elasticSearchIndexUpdateAliases as $aliasName => $aliasBody) {
yield $this->elasticSearch->setElasticSearchIndexAlias(
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/ElasticSearchIndexingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function itUpdatesIndexSettingsAccordingToFlowConfigTest()
'flows' => [
self::FLOW_CODE => [
'description' => 'ElasticSearch Indexing Test Repeat Flow',
'es_index_settings' => ['index' => ['mapping' => ['total_fields' => ['limit' => 2000]]]],
'es_index_settings' => ['index' => ['mapping' => ['total_fields' => ['limit' => 3000]]]],
'producer' => ['service' => DummyFilesystemRepeatProducer::class],
'worker' => ['service' => DummyFilesystemWorker::class],
]
Expand Down

0 comments on commit 9a6d037

Please sign in to comment.