1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace Paysera\Bundle\ApiBundle\Entity; |
5
|
|
|
|
6
|
|
|
class Error |
7
|
|
|
{ |
8
|
|
|
/** |
9
|
|
|
* @var string|null |
10
|
|
|
*/ |
11
|
|
|
private $code; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @var int|null |
15
|
|
|
*/ |
16
|
|
|
private $statusCode; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var string|null |
20
|
|
|
*/ |
21
|
|
|
private $uri; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string|null |
25
|
|
|
*/ |
26
|
|
|
private $message; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var array|null |
30
|
|
|
*/ |
31
|
|
|
private $properties; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var array|null |
35
|
|
|
*/ |
36
|
|
|
private $data; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var array |
40
|
|
|
*/ |
41
|
|
|
private $violations; |
42
|
|
|
|
43
|
41 |
|
public function __construct() |
44
|
|
|
{ |
45
|
41 |
|
$this->violations = []; |
46
|
41 |
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param string|null $code |
50
|
|
|
* |
51
|
|
|
* @return $this |
52
|
|
|
*/ |
53
|
41 |
|
public function setCode($code) |
54
|
|
|
{ |
55
|
41 |
|
$this->code = $code; |
56
|
41 |
|
return $this; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @return string|null |
61
|
|
|
*/ |
62
|
36 |
|
public function getCode() |
63
|
|
|
{ |
64
|
36 |
|
return $this->code; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @param int|null $statusCode |
69
|
|
|
* @return $this |
70
|
|
|
*/ |
71
|
36 |
|
public function setStatusCode($statusCode) |
72
|
|
|
{ |
73
|
36 |
|
$this->statusCode = $statusCode; |
74
|
36 |
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @return int|null |
79
|
|
|
*/ |
80
|
40 |
|
public function getStatusCode() |
81
|
|
|
{ |
82
|
40 |
|
return $this->statusCode; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @param string|null $uri |
87
|
|
|
* |
88
|
|
|
* @return $this |
89
|
|
|
*/ |
90
|
|
|
public function setUri($uri) |
91
|
|
|
{ |
92
|
|
|
$this->uri = $uri; |
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string|null |
98
|
|
|
*/ |
99
|
36 |
|
public function getUri() |
100
|
|
|
{ |
101
|
36 |
|
return $this->uri; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string|null $message |
106
|
|
|
* |
107
|
|
|
* @return $this |
108
|
|
|
*/ |
109
|
36 |
|
public function setMessage($message) |
110
|
|
|
{ |
111
|
36 |
|
$this->message = $message; |
112
|
36 |
|
return $this; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return string|null |
117
|
|
|
*/ |
118
|
36 |
|
public function getMessage() |
119
|
|
|
{ |
120
|
36 |
|
return $this->message; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @param array|null $properties |
125
|
|
|
* |
126
|
|
|
* @return $this |
127
|
|
|
*/ |
128
|
30 |
|
public function setProperties($properties) |
129
|
|
|
{ |
130
|
30 |
|
$this->properties = $properties; |
131
|
30 |
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @return array|null |
136
|
|
|
*/ |
137
|
36 |
|
public function getProperties() |
138
|
|
|
{ |
139
|
36 |
|
return $this->properties; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @param array|null $data |
144
|
|
|
* |
145
|
|
|
* @return $this |
146
|
|
|
*/ |
147
|
30 |
|
public function setData($data) |
148
|
|
|
{ |
149
|
30 |
|
$this->data = $data; |
150
|
30 |
|
return $this; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @return array|null |
155
|
|
|
*/ |
156
|
36 |
|
public function getData() |
157
|
|
|
{ |
158
|
36 |
|
return $this->data; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @return Violation[] |
163
|
|
|
*/ |
164
|
36 |
|
public function getViolations(): array |
165
|
|
|
{ |
166
|
36 |
|
return $this->violations; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @param Violation[] $violations |
171
|
|
|
* |
172
|
|
|
* @return $this |
173
|
|
|
*/ |
174
|
30 |
|
public function setViolations(array $violations) |
175
|
|
|
{ |
176
|
30 |
|
$this->violations = $violations; |
177
|
30 |
|
return $this; |
178
|
|
|
} |
179
|
|
|
} |
180
|
|
|
|