public function __construct(DocumentFactory $documentFactory, AggregationFactory $aggregationFactory, array $searchResponse) { $this->prepareDocuments($searchResponse, $documentFactory); $this->prepareAggregations($searchResponse, $aggregationFactory); }