for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace KGzocha\Searcher;
use KGzocha\Searcher\Criteria\Collection\CriteriaCollectionInterface;
use KGzocha\Searcher\Result\ResultCollection;
/**
* Will pass all results from search to ResultCollection.
* Not recommended to use in development environment due to eventual problems with debugging.
* Should be used only if results are supposed to return array or traversable object.
*
* @author Krzysztof Gzocha <[email protected]>
*/
class WrappedResultsSearcher implements SearcherInterface
{
* @var SearcherInterface
private $searcher;
* @param SearcherInterface $searcher
public function __construct(SearcherInterface $searcher)
$this->searcher = $searcher;
}
* {@inheritdoc}
public function search(
CriteriaCollectionInterface $criteriaCollection
): ResultCollection {
return new ResultCollection(
$this->searcher->search($criteriaCollection)
);