<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Subscriber;

final class SubscriberRecord
{
    public function __construct(
        private readonly string $subscriberClass,
        private readonly array $events,
        private readonly array $metadata = []
    ) {}

    public function subscriberClass(): string { return $this->subscriberClass; }
    public function events(): array { return $this->events; }
    public function metadata(): array { return $this->metadata; }

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