. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Contracts; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Webtrees; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\UriInterface; /** * ake a PSR-7 response (using a PSR-17 response factory). */ interface ResponseFactoryInterface { /** * Redirect to a named route. * * @param string $route_name * @param array|null> $parameters * @param int $status * * @return ResponseInterface * */ public function redirect( string $route_name, array $parameters = [], int $status = StatusCodeInterface::STATUS_FOUND ): ResponseInterface; /** * Redirect to a URL. * * @param UriInterface|string $url * @param int $code * * @return ResponseInterface */ public function redirectUrl(UriInterface|string $url, int $code = StatusCodeInterface::STATUS_FOUND): ResponseInterface; /** * @param string|array|object $content * @param int $code * @param array $headers * * @return ResponseInterface */ public function response(string|array|object $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface; /** * Create and render a view, and embed it in an HTML page. * * @param string $view_name * @param array $view_data * @param int $status * @param string $layout_name * * @return ResponseInterface */ public function view( string $view_name, array $view_data, int $status = StatusCodeInterface::STATUS_OK, string $layout_name = Webtrees::LAYOUT_DEFAULT ): ResponseInterface; }