From bc0661a9c6a66a02c3160960ad4d6349400bd735 Mon Sep 17 00:00:00 2001 From: Fabiana Romagnoli Date: Mon, 11 Nov 2024 15:32:28 +0100 Subject: [PATCH] Fix phpstan --- src/Service/ElasticSearch.php | 17 ++++++++++++----- src/Service/QueueManager.php | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Service/ElasticSearch.php b/src/Service/ElasticSearch.php index 77794f0..bec64bf 100644 --- a/src/Service/ElasticSearch.php +++ b/src/Service/ElasticSearch.php @@ -112,26 +112,33 @@ public function indexExists(string $indexName): Amp\Promise }); } - /** - * @param array|null $indexName - */ public function setElasticSearchIndex(string $indexName): Amp\Promise { return $this->client->createIndex($indexName); } - + /** + * @param string $indexName + * @param array $updateSettingsBody + */ public function setElasticSearchIndexSettings(string $indexName, array $updateSettingsBody = null): Amp\Promise { return $this->client->updateIndexSettings($indexName, $updateSettingsBody); } - + /** + * @param string $indexName + * @param array $updateMappingBody + */ public function setElasticSearchIndexMapping(string $indexName, array $updateMappingBody = null): Amp\Promise { return $this->client->updateMappings($indexName, $updateMappingBody); } + /** + * @param string $indexName + * @param array $aliasBody + */ public function setElasticSearchIndexAlias(string $indexName, string $aliasName, array $aliasBody = null): Amp\Promise { return $this->client->createOrUpdateAlias($indexName, $aliasName, $aliasBody); diff --git a/src/Service/QueueManager.php b/src/Service/QueueManager.php index 1ce13bb..4e12dfd 100644 --- a/src/Service/QueueManager.php +++ b/src/Service/QueueManager.php @@ -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(