diff --git a/src/PropertySuggester/ResultBuilder.php b/src/PropertySuggester/ResultBuilder.php index 71947d6..786572b 100644 --- a/src/PropertySuggester/ResultBuilder.php +++ b/src/PropertySuggester/ResultBuilder.php @@ -18,7 +18,7 @@ class ResultBuilder { /** - * @var $EntityTitleLookup + * @var EntityTitleLookup */ private $entityTitleLookup; @@ -94,13 +94,14 @@ private function buildEntry( EntityId $id, array $clusteredTerms, Suggestion $su $entry['url'] = $this->entityTitleLookup->getTitleForId( $id )->getFullUrl(); $entry['rating'] = $suggestion->getProbability(); + /** @var TermIndexEntry[] $matchingTerms */ if ( isset( $clusteredTerms[$id->getSerialization()] ) ) { $matchingTerms = $clusteredTerms[$id->getSerialization()]; } else { $matchingTerms = array(); } + foreach ( $matchingTerms as $term ) { - /** @var $term TermIndexEntry */ switch ( $term->getType() ) { case TermIndexEntry::TYPE_LABEL: $entry['label'] = $term->getText();