<?php namespace App\Utils\ResponseAbstract;

abstract class ResponseAbstract
{
    public $status;
    public $data;
    public $errors;

    abstract public static function builder();

    public function getStatus() : int
    {
        return $this->status;
    }

    public function getData()
    {
        return $this->data;
    }

    public function getErrors() : ?array
    {
        return $this->errors;
    }

    public function setStatus(int $status): void
    {
        $this->status = $status;
    }

    public function setData($data): void
    {
        $this->data = $data;
    }

    public function setErrors(?array $errors): void
    {
        $this->errors = $errors;
    }

    public function toArray(): array
    {
        return [
            'status' => $this->status,
            'data' => $this->data,
            'errors' => $this->errors,
        ];
    }
}