JsonResponse::respond()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
1
<?php namespace Arcanedev\LaravelApiHelper\Contracts\Http;
2
3
/**
4
 * Interface  JsonResponse
5
 *
6
 * @package   Arcanedev\LaravelApiHelper\Contracts\Http
7
 * @author    ARCANEDEV <[email protected]>
8
 */
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