Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class ValidatorError implements JsonSerializable |
||
16 | { |
||
17 | public const FIELD_MESSAGE = "message"; |
||
18 | public const FIELD_VALUE = "value"; |
||
19 | /** @var string */ |
||
20 | protected $message; |
||
21 | /** @var mixed */ |
||
22 | protected $value; |
||
23 | |||
24 | /** |
||
25 | * ValidatorMessage constructor. |
||
26 | * |
||
27 | * @param string|null $message |
||
28 | * @param mixed $value |
||
29 | */ |
||
30 | public function __construct(string $message, $value = null) |
||
31 | { |
||
32 | $this->message = $message; |
||
33 | $this->value = $value; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | */ |
||
39 | public function jsonSerialize(): array |
||
44 | ]; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getMessage(): string |
||
51 | { |
||
52 | return $this->message; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return mixed |
||
57 | */ |
||
58 | public function getValue() |
||
61 | } |
||
62 | } |
||
63 |