<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Graph;

final class DependencyNode
{
    public function __construct(
        private readonly string $id,
        private readonly string $type = 'service',
        private readonly array $metadata = []
    ) {}

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

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