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

ValidationError   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 57
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isError() 0 3 1
A getErrorCode() 0 3 1
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