Skip to content

Commit

Permalink
Make work suggestions optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Apr 17, 2020
1 parent 7a9d454 commit 907f828
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/API/Values/Content/Search/Suggestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 907f828

Please sign in to comment.