@@ 18-26 (lines=9) @@ | ||
15 | * @param string $message |
|
16 | * @param int $code |
|
17 | */ |
|
18 | public function __construct($message, $code = 500) |
|
19 | { |
|
20 | $data = [ |
|
21 | 'status' => 'error', |
|
22 | 'code' => $code, |
|
23 | 'message' => $message, |
|
24 | ]; |
|
25 | parent::__construct(json_encode($data), $code, [], true); |
|
26 | } |
|
27 | } |
|
28 |
@@ 18-27 (lines=10) @@ | ||
15 | * @param Sniff $sniff |
|
16 | * @param int $code |
|
17 | */ |
|
18 | public function __construct(Sniff $sniff, $code = 200) |
|
19 | { |
|
20 | $data = [ |
|
21 | 'status' => 'success', |
|
22 | 'code' => $code, |
|
23 | 'sniff' => $sniff, |
|
24 | ]; |
|
25 | parent::__construct(json_encode($data), $code, [], true); |
|
26 | } |
|
27 | } |
|
28 |