<?php

class OutputMessage
{

    public function __construct()
    {
    }

    public function successOutput($data, $msg): array
    {
        $output_arr = [
            "status_code" => http_response_code(),
            "status" => true,
            "data" => $data,
            "color" => "success",
            "msg" => ucwords(strtolower($msg)),
        ];

        if ($data == "") {
            unset($output_arr["data"]);
        }

        return $output_arr;
    }

    public function errorOutput($msg = "Method Not available", $color = "error"): array
    {
        return [
            "status_code" => 404,
            "status" => false,
            "color" => $color,
            "msg" => ucwords(strtolower($msg)),
        ];
    }
}