Completed
Push — 3.x ( 4d39cb...1b24ec )
by Jeroen
67:58 queued 11s
created

LoggedOutGatekeeperException::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 4
nop 3
dl 0
loc 8
ccs 6
cts 6
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Elgg\Http\Exception;
4
5
use Throwable;
6
use Elgg\GatekeeperException;
7
8
/**
9
 * Thrown when logged in but this isn't allowed
10
 */
11
class LoggedOutGatekeeperException extends GatekeeperException {
12
	
13
	/**
14
	 * {@inheritdoc}
15
	 */
16 1
	public function __construct(string $message = "", int $code = 0, Throwable $previous = null) {
17 1
		if (!$message) {
18 1
			$message = elgg_echo('loggedoutrequired');
19
		}
20 1
		if (!$code) {
21 1
			$code = ELGG_HTTP_FORBIDDEN;
22
		}
23 1
		parent::__construct($message, $code, $previous);
24 1
	}
25
}
26