Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace Arcanedev\LaravelApiHelper\Contracts\Http; |
||
9 | interface JsonResponse |
||
10 | { |
||
11 | /* ----------------------------------------------------------------- |
||
12 | | Main Methods |
||
13 | | ----------------------------------------------------------------- |
||
14 | */ |
||
15 | |||
16 | /** |
||
17 | * Respond with a success response. |
||
18 | * |
||
19 | * @param array $data |
||
20 | * @param int $status |
||
21 | * @param string $code |
||
22 | * @param array $headers |
||
23 | * @param int $options |
||
24 | * |
||
25 | * @return \Illuminate\Http\JsonResponse |
||
26 | */ |
||
27 | public function success(array $data = [], $status = 200, $code = 'success', array $headers = [], $options = 0); |
||
28 | |||
29 | /** |
||
30 | * Respond with an error response. |
||
31 | * |
||
32 | * @param array $data |
||
33 | * @param int $status |
||
34 | * @param string $code |
||
35 | * @param array $headers |
||
36 | * @param int $options |
||
37 | * |
||
38 | * @return \Illuminate\Http\JsonResponse |
||
39 | */ |
||
40 | public function error(array $data = [], $status = 400, $code = 'error', array $headers = [], $options = 0); |
||
41 | |||
42 | /** |
||
43 | * Respond with a json response. |
||
44 | * |
||
45 | * @param array $data |
||
46 | * @param int $status |
||
47 | * @param string $code |
||
48 | * @param array $headers |
||
49 | * @param int $options |
||
50 | * |
||
51 | * @return \Illuminate\Http\JsonResponse |
||
52 | */ |
||
53 | public function respond(array $data, $status = 200, $code, array $headers = [], $options = 0); |
||
54 | } |
||
55 |