From 907f8280c7480d9a0a9e17aa98ee3546726882e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20S=CC=8Cpanja?= Date: Fri, 17 Apr 2020 14:07:37 +0200 Subject: [PATCH] Make work suggestions optional --- lib/API/Values/Content/Search/Suggestion.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/API/Values/Content/Search/Suggestion.php b/lib/API/Values/Content/Search/Suggestion.php index 83789267..e7bee136 100644 --- a/lib/API/Values/Content/Search/Suggestion.php +++ b/lib/API/Values/Content/Search/Suggestion.php @@ -12,11 +12,9 @@ class Suggestion private $suggestionsByOriginalWords = []; /** - * Suggestion constructor. - * * @param \Netgen\EzPlatformSearchExtra\API\Values\Content\Search\WordSuggestion[] $wordSuggestions */ - public function __construct(array $wordSuggestions) + public function __construct(array $wordSuggestions = []) { foreach ($wordSuggestions as $suggestion) { if (!array_key_exists($suggestion->originalWord, $this->suggestionsByOriginalWords)) { @@ -54,9 +52,9 @@ public function getOriginalWords() /** * @param string $originalWord * - * @return \Netgen\EzPlatformSearchExtra\API\Values\Content\Search\WordSuggestion[] - * * @throws \InvalidArgumentException + * + * @return \Netgen\EzPlatformSearchExtra\API\Values\Content\Search\WordSuggestion[] */ public function getSuggestionsByOriginalWord(string $originalWord) {