<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Validation;

final class ValidationIssue
{
    public function __construct(
        private readonly string $severity,
        private readonly string $message,
        private readonly string $serviceId = '',
        private readonly array $metadata = []
    ) {}

    public function severity(): string { return $this->severity; }
    public function message(): string { return $this->message; }
    public function serviceId(): string { return $this->serviceId; }
    public function metadata(): array { return $this->metadata; }

    public function toArray(): array
    {
        return [
            'severity' => $this->severity,
            'message' => $this->message,
            'serviceId' => $this->serviceId,
            'metadata' => $this->metadata,
        ];
    }
}
