1 | <?php |
||
7 | final class Error |
||
8 | { |
||
9 | /** |
||
10 | * @var string|null |
||
11 | */ |
||
12 | private $scope; |
||
13 | |||
14 | const SCOPE_METHOD = 'method'; |
||
15 | const SCOPE_RESOURCE = 'resource'; |
||
16 | const SCOPE_QUERY = 'query'; |
||
17 | const SCOPE_HEADER = 'header'; |
||
18 | const SCOPE_BODY = 'body'; |
||
19 | const SCOPE_SERVER = 'server'; |
||
20 | |||
21 | /** |
||
22 | * Identifier. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | private $key; |
||
27 | |||
28 | /** |
||
29 | * Technical error description. |
||
30 | * |
||
31 | * @var string|null |
||
32 | */ |
||
33 | private $detail; |
||
34 | |||
35 | /** |
||
36 | * Reference to the error causing form field, parameter, value, header, etc. |
||
37 | * |
||
38 | * @var string|null |
||
39 | */ |
||
40 | private $reference; |
||
41 | |||
42 | /** |
||
43 | * Parameters which can be used by client in order to display a expressive error message. |
||
44 | * |
||
45 | * @var array|null |
||
46 | */ |
||
47 | private $arguments; |
||
48 | |||
49 | /** |
||
50 | * @param string|null $scope |
||
51 | * @param string $key |
||
52 | * @param string|null $detail |
||
53 | * @param string|null $reference |
||
54 | * @param array $arguments |
||
55 | */ |
||
56 | public function __construct( |
||
69 | |||
70 | /** |
||
71 | * @return null|string |
||
72 | */ |
||
73 | public function getScope() |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getKey(): string |
||
85 | |||
86 | /** |
||
87 | * @return string|null |
||
88 | */ |
||
89 | public function getDetail() |
||
93 | |||
94 | /** |
||
95 | * @return string|null |
||
96 | */ |
||
97 | public function getReference() |
||
101 | |||
102 | /** |
||
103 | * @return array|null |
||
104 | */ |
||
105 | public function getArguments() |
||
109 | } |
||
110 |