<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Compiler\Factory;

final class FactoryGenerationResult
{
    public function __construct(
        private readonly string $serviceId,
        private readonly string $className,
        private readonly string $file,
        private readonly bool $generated,
        private readonly array $warnings = []
    ) {}

    public function serviceId(): string { return $this->serviceId; }
    public function className(): string { return $this->className; }
    public function file(): string { return $this->file; }
    public function generated(): bool { return $this->generated; }
    public function warnings(): array { return $this->warnings; }

    public function toArray(): array
    {
        return [
            'serviceId' => $this->serviceId,
            'className' => $this->className,
            'file' => $this->file,
            'generated' => $this->generated,
            'warnings' => $this->warnings,
        ];
    }
}
