<?php 

require_once 'vendor/autoload.php';

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;

class ResponseHelper
{
    public static function responseError($message = "Không xác định lỗi")
    {
        $response = new JsonResponse([
            'status'  => 'error',
            'message' => $message

        ]);

        $response->send();
        exit;
    }

    public static function responseSuccess($data = null)
    {
        $response = new JsonResponse([
            'status' => 'success',
            'data'   => $data
        ]);

        $response->send();
        exit;
    }
}

?>
