aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php
blob: 0a0c04f671d5b9a04eb7026f68c84ebad1bc72e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OCP\AppFramework\Http;

use OCP\AppFramework\Http;
use OCP\IURLGenerator;

/**
 * Redirects to the default app
 *
 * @since 16.0.0
 * @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead
 * @template S of Http::STATUS_*
 * @template H of array<string, mixed>
 * @template-extends RedirectResponse<Http::STATUS_*, array<string, mixed>>
 */
class RedirectToDefaultAppResponse extends RedirectResponse {
	/**
	 * Creates a response that redirects to the default app
	 *
	 * @param S $status
	 * @param H $headers
	 * @since 16.0.0
	 * @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead
	 */
	public function __construct(int $status = Http::STATUS_SEE_OTHER, array $headers = []) {
		$urlGenerator = \OCP\Server::get(IURLGenerator::class);
		parent::__construct($urlGenerator->linkToDefaultPageUrl(), $status, $headers);
	}
}