<?php
declare(strict_types=1);

namespace App\ServiceResults;

use App\Contracts\ServiceResult as ServiceResultContract;
use App\Contracts\ServiceResultError as ServiceResultErrorContract;

abstract class ServiceResult implements ServiceResultContract
{
    public function isSuccess(): bool
    {
        return $this->isError() === false;
    }

    public function isError(): bool
    {
        return $this instanceof ServiceResultErrorContract === true;
    }
}
