Skip to content

Commit

Permalink
fix: Fixed AjaxNodesExplorerController with SearchResultsInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Mar 19, 2024
1 parent 77a1bef commit 06e510d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/SearchEngine/SearchResultsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace RZ\Roadiz\CoreBundle\SearchEngine;

/**
* @extends \Iterator<SolrSearchResultItem>
*/
interface SearchResultsInterface extends \Iterator
{
public function getResultCount(): int;
Expand Down
9 changes: 3 additions & 6 deletions src/SearchEngine/SolrSearchResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ protected function getHydratedItem(array $item): mixed
DocumentTranslation::class,
$item[SolariumDocumentTranslation::IDENTIFIER_KEY]
);
if (null === $documentTranslation) {
return null;
}
return $documentTranslation->getDocument();
return $documentTranslation?->getDocument();
}
}

Expand All @@ -143,11 +140,11 @@ protected function getHydratedItem(array $item): mixed
* Return the current element
*
* @link https://php.net/manual/en/iterator.current.php
* @return mixed Can return any type.
* @return SolrSearchResultItem
* @since 5.0
*/
#[\ReturnTypeWillChange]
public function current(): mixed
public function current(): SolrSearchResultItem
{
return $this->getResultItems()[$this->position];
}
Expand Down

0 comments on commit 06e510d

Please sign in to comment.