Passed
Push — master ( ee4606...24a9ec )
by Jean-Christophe
06:42
created

ConstraintViolation   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Test Coverage

Coverage 54.84%

Importance

Changes 0
Metric Value
wmc 11
eloc 21
dl 0
loc 93
ccs 17
cts 31
cp 0.5484
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A setValidatorType() 0 2 1
A setValue() 0 2 1
A setSeverity() 0 2 1
A setMember() 0 2 1
A setMessage() 0 2 1
A getMessage() 0 2 1
A __construct() 0 6 1
A getValidatorType() 0 2 1
A getSeverity() 0 2 1
A getMember() 0 2 1
A getValue() 0 2 1
1
<?php
2
3
namespace Ubiquity\contents\validation\validators;
4
5
/**
6
 * Constraint Violation Generated During Validation with the ValidatorsManager
7
 *
8
 * Ubiquity\contents\validation\validators$ConstraintViolation
9
 * This class is part of Ubiquity
10
 *
11
 * @author jcheron <[email protected]>
12
 * @version 1.0.0
13
 *
14
 */
15
class ConstraintViolation {
16
	protected $message;
17
	protected $value;
18
	protected $member;
19
	protected $validatorType;
20
	protected $severity;
21
22 3
	public function __construct($message, $value, $member, $validatorType, $severity) {
23 3
		$this->message = $message;
24 3
		$this->severity = $severity;
25 3
		$this->value = $value;
26 3
		$this->member = $member;
27 3
		$this->validatorType = $validatorType;
28 3
	}
29
30
	/**
31
	 *
32
	 * @return mixed
33
	 */
34 2
	public function getMessage() {
35 2
		return $this->message;
36
	}
37
38
	/**
39
	 *
40
	 * @return mixed
41
	 */
42 1
	public function getValue() {
43 1
		return $this->value;
44
	}
45
46
	/**
47
	 *
48
	 * @return mixed
49
	 */
50 1
	public function getMember() {
51 1
		return $this->member;
52
	}
53
54
	/**
55
	 *
56
	 * @return mixed
57
	 */
58 2
	public function getValidatorType() {
59 2
		return $this->validatorType;
60
	}
61
62
	/**
63
	 *
64
	 * @return mixed
65
	 */
66 1
	public function getSeverity() {
67 1
		return $this->severity;
68
	}
69
70
	/**
71
	 *
72
	 * @param mixed $message
73
	 */
74
	public function setMessage($message) {
75
		$this->message = $message;
76
	}
77
78
	/**
79
	 *
80
	 * @param mixed $value
81
	 */
82
	public function setValue($value) {
83
		$this->value = $value;
84
	}
85
86
	/**
87
	 *
88
	 * @param mixed $member
89
	 */
90
	public function setMember($member) {
91
		$this->member = $member;
92
	}
93
94
	/**
95
	 *
96
	 * @param mixed $validatorType
97
	 */
98
	public function setValidatorType($validatorType) {
99
		$this->validatorType = $validatorType;
100
	}
101
102
	/**
103
	 *
104
	 * @param mixed $severity
105
	 */
106
	public function setSeverity($severity) {
107
		$this->severity = $severity;
108
	}
109
}
110
111