<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Compatibility\Adapters;

use PpPhp\Core\Platform\Compatibility\CompatibilityAdapter;
use PpPhp\Core\Platform\Runtime\ManifestServiceLoader;

final class LegacyManifestAdapter extends CompatibilityAdapter
{
    public function __construct(private readonly ManifestServiceLoader $loader = new ManifestServiceLoader())
    {
        parent::__construct('legacy-manifest-adapter', 'core/Manifest + core/Discovery/ManifestReader', 'core/Platform/Runtime/ManifestServiceLoader + UMF', 'active');
    }

    public function loadServices(string $basePath): array { return $this->loader->load($basePath); }
    public function read(string $basePath): array { return $this->loadServices($basePath); }
}
