1 | <?php |
||
9 | class ApiException extends Exception |
||
10 | { |
||
11 | const INVALID_REQUEST = 'invalid_request'; |
||
12 | const INVALID_PARAMETERS = 'invalid_parameters'; |
||
13 | const INVALID_STATE = 'invalid_state'; |
||
14 | const INVALID_GRANT = 'invalid_grant'; |
||
15 | const INVALID_CODE = 'invalid_code'; |
||
16 | const UNAUTHORIZED = 'unauthorized'; |
||
17 | const FORBIDDEN = 'forbidden'; |
||
18 | const NOT_FOUND = 'not_found'; |
||
19 | const RATE_LIMIT_EXCEEDED = 'rate_limit_exceeded'; |
||
20 | const INTERNAL_SERVER_ERROR = 'internal_server_error'; |
||
21 | const NOT_ACCEPTABLE = 'not_acceptable'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $errorCode; |
||
27 | |||
28 | /** |
||
29 | * @var int|null |
||
30 | */ |
||
31 | private $statusCode; |
||
32 | |||
33 | /** |
||
34 | * @var array|null |
||
35 | */ |
||
36 | private $properties; |
||
37 | |||
38 | /** |
||
39 | * @var array|null |
||
40 | */ |
||
41 | private $data; |
||
42 | |||
43 | /** |
||
44 | * @var Violation[] |
||
45 | */ |
||
46 | private $violations; |
||
47 | |||
48 | /** |
||
49 | * @param string $errorCode |
||
50 | * @param string|null $message |
||
51 | * @param int|null $statusCode |
||
52 | * @param Exception|null $previous |
||
53 | * @param array|null $properties |
||
54 | * @param array|null $data |
||
55 | * @param array $violations |
||
56 | */ |
||
57 | 41 | public function __construct( |
|
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | 30 | public function getErrorCode() |
|
82 | |||
83 | /** |
||
84 | * @return int|null |
||
85 | */ |
||
86 | 30 | public function getStatusCode() |
|
90 | |||
91 | /** |
||
92 | * @param array|null $properties |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function setProperties($properties) |
||
101 | |||
102 | /** |
||
103 | * @return array|null |
||
104 | */ |
||
105 | 30 | public function getProperties() |
|
109 | |||
110 | /** |
||
111 | * @param array|null $data |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | public function setData($data) |
||
120 | |||
121 | /** |
||
122 | * @return array|null |
||
123 | */ |
||
124 | 30 | public function getData() |
|
128 | |||
129 | /** |
||
130 | * @return Violation[] |
||
131 | */ |
||
132 | 30 | public function getViolations() |
|
136 | |||
137 | /** |
||
138 | * @param Violation[] $violations |
||
139 | * |
||
140 | * @return $this |
||
141 | */ |
||
142 | 19 | public function setViolations($violations) |
|
147 | } |
||
148 |