@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * NOTE: not typehints due to compatibility with Laravel's method signature. |
88 | 88 | * @noinspection PhpMissingReturnTypeInspection |
89 | - * @noinspection ReturnTypeCanBeDeclaredInspection |
|
89 | + * @noinspection ReturnTypeCanBeDeclaredInspection |
|
90 | 90 | * @noinspection PhpMissingParamTypeInspection |
91 | 91 | */ |
92 | 92 | protected function mergeConfigFrom($path, $key) |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | Util::sortArrayByPri($merged_config['converter']['classes']); |
108 | 108 | |
109 | - $this->app['config']->set($key, $merged_config); |
|
110 | - } |
|
109 | + $this->app['config']->set($key, $merged_config); |
|
110 | + } |
|
111 | 111 | |
112 | 112 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @throws Ex\ArrayWithMixedKeysException |
91 | 91 | */ |
92 | 92 | public static function success($data = null, int $api_code = null, array $placeholders = null, |
93 | - int $http_code = null, int $json_opts = null): HttpResponse |
|
93 | + int $http_code = null, int $json_opts = null): HttpResponse |
|
94 | 94 | { |
95 | 95 | return static::asSuccess($api_code) |
96 | 96 | ->withData($data) |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @throws Ex\ArrayWithMixedKeysException |
124 | 124 | */ |
125 | 125 | public static function error(int $api_code, array $placeholders = null, $data = null, int $http_code = null, |
126 | - int $json_opts = null): HttpResponse |
|
126 | + int $json_opts = null): HttpResponse |
|
127 | 127 | { |
128 | 128 | return static::asError($api_code) |
129 | 129 | ->withPlaceholders($placeholders) |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public function withJsonOptions(int $json_opts = null): self |
216 | 216 | { |
217 | 217 | Validator::assertIsType('json_opts', $json_opts, [Type::INTEGER, |
218 | - Type::NULL]); |
|
218 | + Type::NULL]); |
|
219 | 219 | $this->json_opts = $json_opts; |
220 | 220 | |
221 | 221 | return $this; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | public function withDebugData(array $debug_data = null): self |
230 | 230 | { |
231 | 231 | Validator::assertIsType('$debug_data', $debug_data, [Type::ARRAY, |
232 | - Type::NULL]); |
|
232 | + Type::NULL]); |
|
233 | 233 | $this->debug_data = $debug_data; |
234 | 234 | |
235 | 235 | return $this; |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public function withMessage(string $msg = null): self |
244 | 244 | { |
245 | 245 | Validator::assertIsType('message', $msg, [Type::STRING, |
246 | - Type::NULL]); |
|
246 | + Type::NULL]); |
|
247 | 247 | $this->message = $msg; |
248 | 248 | |
249 | 249 | return $this; |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | * @noinspection PhpTooManyParametersInspection |
339 | 339 | */ |
340 | 340 | protected function make(bool $success, int $api_code, $msg_or_api_code, $data = null, |
341 | - int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
342 | - int $json_opts = null, array $debug_data = null): HttpResponse |
|
341 | + int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
342 | + int $json_opts = null, array $debug_data = null): HttpResponse |
|
343 | 343 | { |
344 | 344 | $http_headers = $http_headers ?? []; |
345 | 345 | $http_code = $http_code ?? ($success ? RB::DEFAULT_HTTP_CODE_OK : RB::DEFAULT_HTTP_CODE_ERROR); |
@@ -384,8 +384,8 @@ discard block |
||
384 | 384 | * @noinspection PhpTooManyParametersInspection |
385 | 385 | */ |
386 | 386 | protected function buildResponse(bool $success, int $api_code, |
387 | - $msg_or_api_code, array $placeholders = null, |
|
388 | - $data = null, array $debug_data = null): array |
|
387 | + $msg_or_api_code, array $placeholders = null, |
|
388 | + $data = null, array $debug_data = null): array |
|
389 | 389 | { |
390 | 390 | // ensure $data is either @null, array or object of class with configured mapping. |
391 | 391 | $data = (new Converter())->convert($data); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @throws Ex\ArrayWithMixedKeysException |
95 | 95 | */ |
96 | 96 | protected static function processException(\Throwable $ex, array $ex_cfg, |
97 | - int $fallback_http_code = HttpResponse::HTTP_INTERNAL_SERVER_ERROR) |
|
97 | + int $fallback_http_code = HttpResponse::HTTP_INTERNAL_SERVER_ERROR) |
|
98 | 98 | { |
99 | 99 | $api_code = $ex_cfg['api_code']; |
100 | 100 | $http_code = $ex_cfg['http_code'] ?? $fallback_http_code; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @throws Ex\ArrayWithMixedKeysException |
179 | 179 | */ |
180 | 180 | protected function unauthenticated(/** @scrutinizer ignore-unused */ $request, |
181 | - AuthException $exception): HttpResponse |
|
181 | + AuthException $exception): HttpResponse |
|
182 | 182 | { |
183 | 183 | $cfg = self::getExceptionHandlerConfig(); |
184 | 184 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @throws Ex\ArrayWithMixedKeysException |
209 | 209 | */ |
210 | 210 | protected static function error(Throwable $ex, |
211 | - int $api_code, int $http_code = null, string $error_message = null): HttpResponse |
|
211 | + int $api_code, int $http_code = null, string $error_message = null): HttpResponse |
|
212 | 212 | { |
213 | 213 | $ex_http_code = ($ex instanceof HttpException) ? $ex->getStatusCode() : $ex->getCode(); |
214 | 214 | $http_code = $http_code ?? $ex_http_code; |
@@ -22,72 +22,72 @@ discard block |
||
22 | 22 | */ |
23 | 23 | class BaseApiCodes |
24 | 24 | { |
25 | - use ApiCodesHelpers; |
|
26 | - |
|
27 | - /** |
|
28 | - * protected code range - lowest code for reserved range. |
|
29 | - * |
|
30 | - * @var int |
|
31 | - */ |
|
32 | - public const RESERVED_MIN_API_CODE_OFFSET = 0; |
|
33 | - |
|
34 | - /** |
|
35 | - * protected code range - highest code for reserved range |
|
36 | - * |
|
37 | - * @var int |
|
38 | - */ |
|
39 | - public const RESERVED_MAX_API_CODE_OFFSET = 19; |
|
40 | - |
|
41 | - /** |
|
42 | - * built-in codes: OK |
|
43 | - * |
|
44 | - * @var int |
|
45 | - */ |
|
46 | - protected const OK_OFFSET = 0; |
|
47 | - /** |
|
48 | - * built-in code for fallback message mapping |
|
49 | - * |
|
50 | - * @var int |
|
51 | - */ |
|
52 | - protected const NO_ERROR_MESSAGE_OFFSET = 1; |
|
53 | - /** |
|
54 | - * built-in error code for HTTP_NOT_FOUND exception |
|
55 | - * |
|
56 | - * @var int |
|
57 | - */ |
|
58 | - protected const EX_HTTP_NOT_FOUND_OFFSET = 10; |
|
59 | - /** |
|
60 | - * built-in error code for HTTP_SERVICE_UNAVAILABLE exception |
|
61 | - * |
|
62 | - * @var int |
|
63 | - */ |
|
64 | - protected const EX_HTTP_SERVICE_UNAVAILABLE_OFFSET = 11; |
|
65 | - /** |
|
66 | - * built-in error code for HTTP_EXCEPTION |
|
67 | - * |
|
68 | - * @var int |
|
69 | - */ |
|
70 | - protected const EX_HTTP_EXCEPTION_OFFSET = 12; |
|
71 | - /** |
|
72 | - * built-in error code for UNCAUGHT_EXCEPTION |
|
73 | - * |
|
74 | - * @var int |
|
75 | - */ |
|
76 | - protected const EX_UNCAUGHT_EXCEPTION_OFFSET = 13; |
|
77 | - |
|
78 | - /** |
|
79 | - * built-in error code for \Illuminate\Auth\AuthenticationException |
|
80 | - * |
|
81 | - * @var int |
|
82 | - */ |
|
83 | - protected const EX_AUTHENTICATION_EXCEPTION_OFFSET = 14; |
|
84 | - |
|
85 | - /** |
|
86 | - * built-in error code for \Illuminate\Auth\AuthenticationException |
|
87 | - * |
|
88 | - * @var int |
|
89 | - */ |
|
90 | - protected const EX_VALIDATION_EXCEPTION_OFFSET = 15; |
|
25 | + use ApiCodesHelpers; |
|
26 | + |
|
27 | + /** |
|
28 | + * protected code range - lowest code for reserved range. |
|
29 | + * |
|
30 | + * @var int |
|
31 | + */ |
|
32 | + public const RESERVED_MIN_API_CODE_OFFSET = 0; |
|
33 | + |
|
34 | + /** |
|
35 | + * protected code range - highest code for reserved range |
|
36 | + * |
|
37 | + * @var int |
|
38 | + */ |
|
39 | + public const RESERVED_MAX_API_CODE_OFFSET = 19; |
|
40 | + |
|
41 | + /** |
|
42 | + * built-in codes: OK |
|
43 | + * |
|
44 | + * @var int |
|
45 | + */ |
|
46 | + protected const OK_OFFSET = 0; |
|
47 | + /** |
|
48 | + * built-in code for fallback message mapping |
|
49 | + * |
|
50 | + * @var int |
|
51 | + */ |
|
52 | + protected const NO_ERROR_MESSAGE_OFFSET = 1; |
|
53 | + /** |
|
54 | + * built-in error code for HTTP_NOT_FOUND exception |
|
55 | + * |
|
56 | + * @var int |
|
57 | + */ |
|
58 | + protected const EX_HTTP_NOT_FOUND_OFFSET = 10; |
|
59 | + /** |
|
60 | + * built-in error code for HTTP_SERVICE_UNAVAILABLE exception |
|
61 | + * |
|
62 | + * @var int |
|
63 | + */ |
|
64 | + protected const EX_HTTP_SERVICE_UNAVAILABLE_OFFSET = 11; |
|
65 | + /** |
|
66 | + * built-in error code for HTTP_EXCEPTION |
|
67 | + * |
|
68 | + * @var int |
|
69 | + */ |
|
70 | + protected const EX_HTTP_EXCEPTION_OFFSET = 12; |
|
71 | + /** |
|
72 | + * built-in error code for UNCAUGHT_EXCEPTION |
|
73 | + * |
|
74 | + * @var int |
|
75 | + */ |
|
76 | + protected const EX_UNCAUGHT_EXCEPTION_OFFSET = 13; |
|
77 | + |
|
78 | + /** |
|
79 | + * built-in error code for \Illuminate\Auth\AuthenticationException |
|
80 | + * |
|
81 | + * @var int |
|
82 | + */ |
|
83 | + protected const EX_AUTHENTICATION_EXCEPTION_OFFSET = 14; |
|
84 | + |
|
85 | + /** |
|
86 | + * built-in error code for \Illuminate\Auth\AuthenticationException |
|
87 | + * |
|
88 | + * @var int |
|
89 | + */ |
|
90 | + protected const EX_VALIDATION_EXCEPTION_OFFSET = 15; |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * Returns base code mapping array |
@@ -98,140 +98,140 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @throws Ex\MissingConfigurationKeyException |
100 | 100 | */ |
101 | - protected static function getBaseMap(): array |
|
102 | - { |
|
103 | - $tpl = 'response-builder::builder.http_%d'; |
|
104 | - |
|
105 | - return [ |
|
106 | - self::OK() => 'response-builder::builder.ok', |
|
107 | - self::NO_ERROR_MESSAGE() => 'response-builder::builder.no_error_message', |
|
108 | - self::EX_HTTP_EXCEPTION() => 'response-builder::builder.http_exception', |
|
109 | - self::EX_UNCAUGHT_EXCEPTION() => 'response-builder::builder.uncaught_exception', |
|
110 | - self::EX_HTTP_NOT_FOUND() => sprintf($tpl, HttpResponse::HTTP_NOT_FOUND), |
|
111 | - self::EX_HTTP_SERVICE_UNAVAILABLE() => sprintf($tpl, HttpResponse::HTTP_SERVICE_UNAVAILABLE), |
|
112 | - self::EX_AUTHENTICATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNAUTHORIZED), |
|
113 | - self::EX_VALIDATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNPROCESSABLE_ENTITY), |
|
114 | - ]; |
|
115 | - } |
|
116 | - |
|
117 | - /** |
|
118 | - * Returns API code for internal code OK |
|
119 | - * |
|
120 | - * @return int valid API code in current range |
|
121 | - * |
|
122 | - * @noinspection PhpMethodNamingConventionInspection |
|
123 | - * |
|
124 | - * @throws \InvalidArgumentException |
|
125 | - * @throws Ex\MissingConfigurationKeyException |
|
126 | - */ |
|
127 | - public static function OK(): int |
|
128 | - { |
|
129 | - return static::getCodeForInternalOffset(static::OK_OFFSET); |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * Returns API code for internal code NO_ERROR_MESSAGE |
|
134 | - * |
|
135 | - * @return int valid API code in current range |
|
136 | - * |
|
137 | - * @noinspection PhpMethodNamingConventionInspection |
|
138 | - * |
|
139 | - * @throws \InvalidArgumentException |
|
140 | - * @throws Ex\MissingConfigurationKeyException |
|
141 | - */ |
|
142 | - public static function NO_ERROR_MESSAGE(): int |
|
143 | - { |
|
144 | - return static::getCodeForInternalOffset(static::NO_ERROR_MESSAGE_OFFSET); |
|
145 | - } |
|
146 | - |
|
147 | - /** |
|
148 | - * Returns API code for internal code EX_HTTP_NOT_FOUND |
|
149 | - * |
|
150 | - * @return int valid API code in current range |
|
151 | - * |
|
152 | - * @noinspection PhpMethodNamingConventionInspection |
|
153 | - * |
|
154 | - * @throws \InvalidArgumentException |
|
155 | - * @throws Ex\MissingConfigurationKeyException |
|
156 | - */ |
|
157 | - public static function EX_HTTP_NOT_FOUND(): int |
|
158 | - { |
|
159 | - return static::getCodeForInternalOffset(static::EX_HTTP_NOT_FOUND_OFFSET); |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * Returns API code for internal code EX_HTTP_EXCEPTION |
|
164 | - * |
|
165 | - * @return int valid API code in current range |
|
166 | - * |
|
167 | - * @noinspection PhpMethodNamingConventionInspection |
|
168 | - * |
|
169 | - * @throws \InvalidArgumentException |
|
170 | - * @throws Ex\MissingConfigurationKeyException |
|
171 | - */ |
|
172 | - public static function EX_HTTP_EXCEPTION(): int |
|
173 | - { |
|
174 | - return static::getCodeForInternalOffset(static::EX_HTTP_EXCEPTION_OFFSET); |
|
175 | - } |
|
176 | - |
|
177 | - /** |
|
178 | - * Returns API code for internal code EX_UNCAUGHT_EXCEPTION |
|
179 | - * |
|
180 | - * @return int valid API code in current range |
|
181 | - * |
|
182 | - * @noinspection PhpMethodNamingConventionInspection |
|
183 | - * |
|
184 | - * @throws \InvalidArgumentException |
|
185 | - * @throws Ex\MissingConfigurationKeyException |
|
186 | - */ |
|
187 | - public static function EX_UNCAUGHT_EXCEPTION(): int |
|
188 | - { |
|
189 | - return static::getCodeForInternalOffset(static::EX_UNCAUGHT_EXCEPTION_OFFSET); |
|
190 | - } |
|
191 | - |
|
192 | - /** |
|
193 | - * Returns API code for internal code EX_AUTHENTICATION_EXCEPTION |
|
194 | - * |
|
195 | - * @return int valid API code in current range |
|
196 | - * |
|
197 | - * @noinspection PhpMethodNamingConventionInspection |
|
198 | - * |
|
199 | - * @throws \InvalidArgumentException |
|
200 | - * @throws Ex\MissingConfigurationKeyException |
|
201 | - */ |
|
202 | - public static function EX_AUTHENTICATION_EXCEPTION(): int |
|
203 | - { |
|
204 | - return static::getCodeForInternalOffset(static::EX_AUTHENTICATION_EXCEPTION_OFFSET); |
|
205 | - } |
|
206 | - |
|
207 | - /** |
|
208 | - * Returns API code for internal code EX_VALIDATION_EXCEPTION |
|
209 | - * |
|
210 | - * @return int valid API code in current range |
|
211 | - * |
|
212 | - * @noinspection PhpMethodNamingConventionInspection |
|
213 | - * |
|
214 | - * @throws \InvalidArgumentException |
|
215 | - * @throws Ex\MissingConfigurationKeyException |
|
216 | - */ |
|
217 | - public static function EX_VALIDATION_EXCEPTION(): int |
|
218 | - { |
|
219 | - return static::getCodeForInternalOffset(static::EX_VALIDATION_EXCEPTION_OFFSET); |
|
220 | - } |
|
221 | - |
|
222 | - /** |
|
223 | - * Returns API code for internal code EX_HTTP_SERVICE_UNAVAILABLE |
|
224 | - * |
|
225 | - * @return int valid API code in current range |
|
226 | - * |
|
227 | - * @noinspection PhpMethodNamingConventionInspection |
|
228 | - * |
|
229 | - * @throws \InvalidArgumentException |
|
230 | - * @throws Ex\MissingConfigurationKeyException |
|
231 | - */ |
|
232 | - public static function EX_HTTP_SERVICE_UNAVAILABLE(): int |
|
233 | - { |
|
234 | - return static::getCodeForInternalOffset(static::EX_HTTP_SERVICE_UNAVAILABLE_OFFSET); |
|
235 | - } |
|
101 | + protected static function getBaseMap(): array |
|
102 | + { |
|
103 | + $tpl = 'response-builder::builder.http_%d'; |
|
104 | + |
|
105 | + return [ |
|
106 | + self::OK() => 'response-builder::builder.ok', |
|
107 | + self::NO_ERROR_MESSAGE() => 'response-builder::builder.no_error_message', |
|
108 | + self::EX_HTTP_EXCEPTION() => 'response-builder::builder.http_exception', |
|
109 | + self::EX_UNCAUGHT_EXCEPTION() => 'response-builder::builder.uncaught_exception', |
|
110 | + self::EX_HTTP_NOT_FOUND() => sprintf($tpl, HttpResponse::HTTP_NOT_FOUND), |
|
111 | + self::EX_HTTP_SERVICE_UNAVAILABLE() => sprintf($tpl, HttpResponse::HTTP_SERVICE_UNAVAILABLE), |
|
112 | + self::EX_AUTHENTICATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNAUTHORIZED), |
|
113 | + self::EX_VALIDATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNPROCESSABLE_ENTITY), |
|
114 | + ]; |
|
115 | + } |
|
116 | + |
|
117 | + /** |
|
118 | + * Returns API code for internal code OK |
|
119 | + * |
|
120 | + * @return int valid API code in current range |
|
121 | + * |
|
122 | + * @noinspection PhpMethodNamingConventionInspection |
|
123 | + * |
|
124 | + * @throws \InvalidArgumentException |
|
125 | + * @throws Ex\MissingConfigurationKeyException |
|
126 | + */ |
|
127 | + public static function OK(): int |
|
128 | + { |
|
129 | + return static::getCodeForInternalOffset(static::OK_OFFSET); |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * Returns API code for internal code NO_ERROR_MESSAGE |
|
134 | + * |
|
135 | + * @return int valid API code in current range |
|
136 | + * |
|
137 | + * @noinspection PhpMethodNamingConventionInspection |
|
138 | + * |
|
139 | + * @throws \InvalidArgumentException |
|
140 | + * @throws Ex\MissingConfigurationKeyException |
|
141 | + */ |
|
142 | + public static function NO_ERROR_MESSAGE(): int |
|
143 | + { |
|
144 | + return static::getCodeForInternalOffset(static::NO_ERROR_MESSAGE_OFFSET); |
|
145 | + } |
|
146 | + |
|
147 | + /** |
|
148 | + * Returns API code for internal code EX_HTTP_NOT_FOUND |
|
149 | + * |
|
150 | + * @return int valid API code in current range |
|
151 | + * |
|
152 | + * @noinspection PhpMethodNamingConventionInspection |
|
153 | + * |
|
154 | + * @throws \InvalidArgumentException |
|
155 | + * @throws Ex\MissingConfigurationKeyException |
|
156 | + */ |
|
157 | + public static function EX_HTTP_NOT_FOUND(): int |
|
158 | + { |
|
159 | + return static::getCodeForInternalOffset(static::EX_HTTP_NOT_FOUND_OFFSET); |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * Returns API code for internal code EX_HTTP_EXCEPTION |
|
164 | + * |
|
165 | + * @return int valid API code in current range |
|
166 | + * |
|
167 | + * @noinspection PhpMethodNamingConventionInspection |
|
168 | + * |
|
169 | + * @throws \InvalidArgumentException |
|
170 | + * @throws Ex\MissingConfigurationKeyException |
|
171 | + */ |
|
172 | + public static function EX_HTTP_EXCEPTION(): int |
|
173 | + { |
|
174 | + return static::getCodeForInternalOffset(static::EX_HTTP_EXCEPTION_OFFSET); |
|
175 | + } |
|
176 | + |
|
177 | + /** |
|
178 | + * Returns API code for internal code EX_UNCAUGHT_EXCEPTION |
|
179 | + * |
|
180 | + * @return int valid API code in current range |
|
181 | + * |
|
182 | + * @noinspection PhpMethodNamingConventionInspection |
|
183 | + * |
|
184 | + * @throws \InvalidArgumentException |
|
185 | + * @throws Ex\MissingConfigurationKeyException |
|
186 | + */ |
|
187 | + public static function EX_UNCAUGHT_EXCEPTION(): int |
|
188 | + { |
|
189 | + return static::getCodeForInternalOffset(static::EX_UNCAUGHT_EXCEPTION_OFFSET); |
|
190 | + } |
|
191 | + |
|
192 | + /** |
|
193 | + * Returns API code for internal code EX_AUTHENTICATION_EXCEPTION |
|
194 | + * |
|
195 | + * @return int valid API code in current range |
|
196 | + * |
|
197 | + * @noinspection PhpMethodNamingConventionInspection |
|
198 | + * |
|
199 | + * @throws \InvalidArgumentException |
|
200 | + * @throws Ex\MissingConfigurationKeyException |
|
201 | + */ |
|
202 | + public static function EX_AUTHENTICATION_EXCEPTION(): int |
|
203 | + { |
|
204 | + return static::getCodeForInternalOffset(static::EX_AUTHENTICATION_EXCEPTION_OFFSET); |
|
205 | + } |
|
206 | + |
|
207 | + /** |
|
208 | + * Returns API code for internal code EX_VALIDATION_EXCEPTION |
|
209 | + * |
|
210 | + * @return int valid API code in current range |
|
211 | + * |
|
212 | + * @noinspection PhpMethodNamingConventionInspection |
|
213 | + * |
|
214 | + * @throws \InvalidArgumentException |
|
215 | + * @throws Ex\MissingConfigurationKeyException |
|
216 | + */ |
|
217 | + public static function EX_VALIDATION_EXCEPTION(): int |
|
218 | + { |
|
219 | + return static::getCodeForInternalOffset(static::EX_VALIDATION_EXCEPTION_OFFSET); |
|
220 | + } |
|
221 | + |
|
222 | + /** |
|
223 | + * Returns API code for internal code EX_HTTP_SERVICE_UNAVAILABLE |
|
224 | + * |
|
225 | + * @return int valid API code in current range |
|
226 | + * |
|
227 | + * @noinspection PhpMethodNamingConventionInspection |
|
228 | + * |
|
229 | + * @throws \InvalidArgumentException |
|
230 | + * @throws Ex\MissingConfigurationKeyException |
|
231 | + */ |
|
232 | + public static function EX_HTTP_SERVICE_UNAVAILABLE(): int |
|
233 | + { |
|
234 | + return static::getCodeForInternalOffset(static::EX_HTTP_SERVICE_UNAVAILABLE_OFFSET); |
|
235 | + } |
|
236 | 236 | |
237 | 237 | } |