<?php

namespace App\Classes\ValueObjects\Response;

class RuleEvaluationResult
{
    public bool $success = true;
    public array $messages = [];

    public function __construct(bool $success = true, array $messages = [])
    {
        $this->success = $success;
        $this->messages = $messages;
    }

    public function failed(): bool
    {
        return ! $this->success;
    }

    public function passed(): bool
    {
        return $this->success;
    }

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