react-logo/backend/src/Http/ErrorResponse.php

22 lines
536 B
PHP
Raw Normal View History

2020-02-17 22:28:57 +01:00
<?php
namespace App\Http;
use Symfony\Component\HttpFoundation\JsonResponse;
class ErrorResponse extends JsonResponse {
public function __construct($code, $message, $data = null, $status = 400, $headers = [], $json = false) {
parent::__construct(
[
'error' => [
'code' => $code,
'message' => $message,
'data' => $data,
],
],
$status,
$headers,
$json,
);
}
}