. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fisharebest\Webtrees\Validator; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; /** * Search for genealogy data */ class SearchPhoneticAction implements RequestHandlerInterface { /** * The standard search. * * @param ServerRequestInterface $request * * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { $tree = Validator::attributes($request)->tree(); $params = (array) $request->getParsedBody(); return redirect(route(SearchPhoneticPage::class, [ 'firstname' => $params['firstname'] ?? '', 'lastname' => $params['lastname'] ?? '', 'place' => $params['place'] ?? '', 'search_trees' => $params['search_trees'] ?? [], 'soundex' => $params['soundex'] ?? 'Russell', 'tree' => $tree->name(), ])); } }