. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fisharebest\Webtrees\Validator; use Illuminate\Support\Collection; use Psr\Http\Message\ServerRequestInterface; /** * Autocomplete handler for surnames */ class AutoCompleteSurname extends AbstractAutocompleteHandler { /** * @param ServerRequestInterface $request * * @return Collection */ protected function search(ServerRequestInterface $request): Collection { $tree = Validator::attributes($request)->tree(); $query = Validator::queryParams($request)->string('query'); return $this->search_service ->searchSurnames([$tree], [$query], 0, static::LIMIT); } }