1 | <?php |
||
14 | class ErrorResponseFactory extends ResponseFactory |
||
15 | { |
||
16 | /** |
||
17 | * Generate a successful JSON response. |
||
18 | * |
||
19 | * @param mixed $errorCode |
||
20 | * @param int $statusCode |
||
21 | * @param array $message |
||
22 | * @return JsonResponse |
||
23 | */ |
||
24 | public function make( $errorCode, $statusCode = 500, $message = [ ] ):JsonResponse |
||
37 | |||
38 | /** |
||
39 | * Get the skeleton for an error response. |
||
40 | * |
||
41 | * @param string $errorCode |
||
42 | * @param int $statusCode |
||
43 | * @return array |
||
44 | */ |
||
45 | protected function getErrorResponse( string $errorCode, int $statusCode ):array |
||
56 | |||
57 | /** |
||
58 | * Get any error messages for the response. If no message can be found it will |
||
59 | * try to resolve a set message from the translator. |
||
60 | * |
||
61 | * @param string $errorCode |
||
62 | * @param mixed $message |
||
63 | * @return array |
||
64 | */ |
||
65 | protected function getErrorMessages( string $errorCode, $message ):array |
||
80 | } |