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 8ed71a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions src/Service/ElasticSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Webgriffe\Esb\Service;

use Amp;
use Amp\Promise;
use Generator;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
Expand Down Expand Up @@ -112,26 +113,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

0 comments on commit 8ed71a6

Please sign in to comment.