<?php

declare(strict_types=1);

namespace PpPhp\Core\Discovery;

final class DiscoveryItem
{
    public function __construct(
        public readonly string $type,
        public readonly string $id,
        public readonly string $path,
        public readonly array $metadata = []
    ) {
    }

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