<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Kernel;

use PpPhp\Core\Platform\Compatibility\CompatibilityRegistry;
use PpPhp\Core\Platform\Extensions\ExtensionManager;
use PpPhp\Core\Platform\Manifest\ManifestManager;
use PpPhp\Core\Platform\Modules\ModuleManager;
use PpPhp\Core\Platform\Runtime\PlatformRuntimeContext;
use PpPhp\Core\Platform\Services\Registry\RegistryCollection;

final class Platform
{
    public static function boot(string $basePath): PlatformKernel { return PlatformKernel::instance()->boot($basePath); }
    public static function kernel(): PlatformKernel { return PlatformKernel::instance(); }
    public static function runtime(): ?PlatformRuntimeContext { return self::kernel()->runtime(); }
    public static function registries(): RegistryCollection { return self::kernel()->registries(); }
    public static function registry(): RegistryCollection { return self::registries(); }
    public static function compatibility(): CompatibilityRegistry { return self::kernel()->compatibility(); }
    public static function manifests(): ManifestManager { return self::kernel()->manifests(); }
    public static function modules(): ModuleManager { return self::kernel()->modules(); }
    public static function plugins(): ExtensionManager { return self::kernel()->plugins(); }
    public static function packages(): ExtensionManager { return self::kernel()->packages(); }
    public static function themes(): ExtensionManager { return self::kernel()->themes(); }
    public static function reset(): void { PlatformKernel::reset(); }
}
