Passed
Push — master ( c4a666...6ef029 )
by Morris
12:58 queued 12s
created

NotFoundResponse::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Lukas Reschke <[email protected]>
6
 * @author Morris Jobke <[email protected]>
7
 * @author Roeland Jago Douma <[email protected]>
8
 *
9
 * @license AGPL-3.0
10
 *
11
 * This code is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Affero General Public License, version 3,
13
 * as published by the Free Software Foundation.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU Affero General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU Affero General Public License, version 3,
21
 * along with this program. If not, see <http://www.gnu.org/licenses/>
22
 *
23
 */
24
25
namespace OCP\AppFramework\Http;
26
27
/**
28
 * A generic 404 response showing an 404 error page as well to the end-user
29
 * @since 8.1.0
30
 */
31
class NotFoundResponse extends TemplateResponse {
32
33
	/**
34
	 * @since 8.1.0
35
	 */
36
	public function __construct() {
37
		parent::__construct('core', '404', [], 'guest');
38
39
		$this->setContentSecurityPolicy(new ContentSecurityPolicy());
40
		$this->setStatus(404);
41
	}
42
}
43