<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Graph;

final class DependencyEdge
{
    public function __construct(
        private readonly string $from,
        private readonly string $to,
        private readonly string $reason = 'constructor'
    ) {}

    public function from(): string { return $this->from; }
    public function to(): string { return $this->to; }
    public function reason(): string { return $this->reason; }

    public function toArray(): array
    {
        return [
            'from' => $this->from,
            'to' => $this->to,
            'reason' => $this->reason,
        ];
    }
}
