From 28dcb141b0fedc53bf366ea01cda997efc5355e3 Mon Sep 17 00:00:00 2001 From: Divesh Pahuja Date: Thu, 3 Aug 2023 15:05:25 +0200 Subject: [PATCH] [IndexService] Fix default properties in configs - resolves #113 --- src/IndexService/Config/AbstractConfig.php | 10 +++++----- src/IndexService/Config/ElasticSearch.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/IndexService/Config/AbstractConfig.php b/src/IndexService/Config/AbstractConfig.php index e416de89c..867e55a3a 100644 --- a/src/IndexService/Config/AbstractConfig.php +++ b/src/IndexService/Config/AbstractConfig.php @@ -26,23 +26,23 @@ abstract class AbstractConfig implements ConfigInterface { protected string $tenantName; - protected array $attributeConfig; + protected array $attributeConfig = []; - protected array $searchAttributeConfig; + protected array $searchAttributeConfig = []; protected ?AttributeFactory $attributeFactory = null; protected array $attributes = []; - protected array $searchAttributes; + protected array $searchAttributes = []; - protected array $filterTypes; + protected array $filterTypes = []; protected ?WorkerInterface $tenantWorker = null; protected ?array $filterTypeConfig = null; - protected array $options; + protected array $options = []; /** * @param array[]|Attribute[] $attributes diff --git a/src/IndexService/Config/ElasticSearch.php b/src/IndexService/Config/ElasticSearch.php index 33fae084b..23c1f4476 100644 --- a/src/IndexService/Config/ElasticSearch.php +++ b/src/IndexService/Config/ElasticSearch.php @@ -75,9 +75,9 @@ class ElasticSearch extends AbstractConfig implements MockupConfigInterface, Ela public function __construct( AttributeFactory $attributeFactory, string $tenantName, - array $attributes, - array $searchAttributes, - array $filterTypes, + array $attributes = [], + array $searchAttributes = [], + array $filterTypes = [], array $options = [], iterable $synonymProviders = [] ) {