<?php

namespace Signteer\Core\Action;

final class ActionResult
{
    private array $errors = [];
    private $ret = null;

    public function isOk(): bool
    {
        return $this->errors ? false : true;
    }

    public function addError(string $error): self
    {
        $this->errors[] = $error;

        return $this;
    }

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

    public function setReturn($v): self
    {
        $this->ret = $v;

        return $this;
    }

    public function getReturn()
    {
        return $this->ret;
    }
}
