Completed
Pull Request — master (#526)
by Michael
02:11
created

ValidationError::isError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
class ValidationError
4
{
5
	const NAME_EMPTY         = "name_empty";
6
	const NAME_EXISTS        = "name_exists";
7
	const NAME_EXISTS_SUL    = "name_exists";
8
	const NAME_NUMONLY       = "name_numonly";
9
	const NAME_INVALIDCHAR   = "name_invalidchar";
10
	const NAME_SANITISED     = "name_sanitised";
11
	const EMAIL_EMPTY        = "email_empty";
12
	const EMAIL_WIKIMEDIA    = "email_wikimedia";
13
	const EMAIL_INVALID      = "email_invalid";
14
	const EMAIL_MISMATCH     = "email_mismatch";
15
	const OPEN_REQUEST_NAME  = "open_request_name";
16
	const BANNED             = "banned";
17
	const BANNED_TOR         = "banned_tor";
18
19
	/**
20
	 * Summary of $errorCode
21
	 * @var string
22
	 */
23
	private $errorCode;
24
25
	/**
26
	 * Summary of $isError
27
	 * @var bool
28
	 */
29
	private $isError;
30
31
	/**
32
	 * Summary of __construct
33
	 * @param string $errorCode
34
	 * @param bool $isError
35
	 */
36
	public function __construct($errorCode, $isError = true)
37
	{
38
		$this->errorCode = $errorCode;
39
		$this->isError = $isError;
40
	}
41
42
	/**
43
	 * Summary of getErrorCode
44
	 * @return string
45
	 */
46
	public function getErrorCode()
47
	{
48
		return $this->errorCode;
49
	}
50
51
	/**
52
	 * Summary of isError
53
	 * @return bool
54
	 */
55
	public function isError()
56
	{
57
		return $this->isError;
58
	}
59
}
60