Skip to content

Commit

Permalink
Define the proper type for the SolariumAdapter
Browse files Browse the repository at this point in the history
This adapter is always working with Solarium's DocumentInterface so it
does not need to be generic.
  • Loading branch information
stof committed Dec 13, 2024
1 parent aca8768 commit 5c7eaf7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/Adapter/Solarium/SolariumAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
use Pagerfanta\Adapter\AdapterInterface;
use Solarium\Core\Client\ClientInterface;
use Solarium\Core\Client\Endpoint;
use Solarium\Core\Query\DocumentInterface;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Result\Result;

/**
* Adapter which calculates pagination from a Solarium Query.
*
* @template T
*
* @implements AdapterInterface<T>
* @implements AdapterInterface<DocumentInterface>
*/
class SolariumAdapter implements AdapterInterface
{
Expand Down Expand Up @@ -44,12 +43,6 @@ public function getNbResults(): int
return $this->getResultSet()->getNumFound();
}

/**
* @param int<0, max> $offset
* @param int<0, max> $length
*
* @return iterable<array-key, T>
*/
public function getSlice(int $offset, int $length): iterable
{
return $this->getResultSet($offset, $length);
Expand Down

0 comments on commit 5c7eaf7

Please sign in to comment.