<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Compiler;

final class EventCompilerContext
{
    private array $artifacts = [];
    private array $warnings = [];
    private array $metadata = [];

    public function __construct(private readonly string $basePath) {}

    public function basePath(): string { return $this->basePath; }
    public function setArtifact(string $key, array $value): void { $this->artifacts[$key] = $value; }
    public function artifact(string $key): array { return $this->artifacts[$key] ?? []; }
    public function artifacts(): array { return $this->artifacts; }
    public function warning(string $message, array $metadata = []): void { $this->warnings[] = ['message' => $message, 'metadata' => $metadata]; }
    public function warnings(): array { return $this->warnings; }
    public function setMetadata(string $key, mixed $value): void { $this->metadata[$key] = $value; }
    public function metadata(): array { return $this->metadata; }
}
