* @template-extends Response> */ class RedirectResponse extends Response { private $redirectURL; /** * Creates a response that redirects to a url * @param string $redirectURL the url to redirect to * @param S $status * @param H $headers * @since 7.0.0 */ public function __construct(string $redirectURL, int $status = Http::STATUS_SEE_OTHER, array $headers = []) { parent::__construct($status, $headers); $this->redirectURL = $redirectURL; $this->addHeader('Location', $redirectURL); } /** * @return string the url to redirect * @since 7.0.0 */ public function getRedirectURL() { return $this->redirectURL; } }