<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Runtime;

final class ManifestRuntimeBootstrap
{
    public function __construct(
        private readonly ManifestServiceLoader $loader = new ManifestServiceLoader(),
        private readonly PlatformRuntimeBootstrap $bootstrap = new PlatformRuntimeBootstrap()
    ) {
    }

    public function boot(string $basePath): PlatformRuntimeContext
    {
        $services = $this->loader->load($basePath);

        return $this->bootstrap->boot($basePath, $services);
    }
}
