<?php
namespace Composer;

if ( class_exists( InstalledVersions::class, false ) ) {
    return;
}

/**
 * Stub im Stil von Composer/InstalledVersions. Nur das Subset, das
 * Vendor-Code (horstoeko/zugferd) tatsaechlich aufruft, und in der
 * Variante "Package unbekannt -> OutOfBoundsException". Wer die echte
 * Composer-API braucht, hat Composer ohnehin im Tree.
 */
class InstalledVersions
{
    public static function getInstalledPackages(): array { return []; }
    public static function isInstalled(string $packageName, bool $includeDevRequirements = true): bool { return false; }
    public static function satisfies($parser, string $packageName, ?string $constraint = null): bool { return false; }
    public static function getVersionRanges(string $packageName): string {
        throw new \OutOfBoundsException( "Package $packageName is not installed" );
    }
    public static function getVersion(string $packageName): ?string {
        throw new \OutOfBoundsException( "Package $packageName is not installed" );
    }
    public static function getPrettyVersion(string $packageName): ?string {
        throw new \OutOfBoundsException( "Package $packageName is not installed" );
    }
    public static function getReference(string $packageName): ?string {
        throw new \OutOfBoundsException( "Package $packageName is not installed" );
    }
    public static function getInstallPath(string $packageName): ?string {
        throw new \OutOfBoundsException( "Package $packageName is not installed" );
    }
    public static function getRootPackage(): array {
        return [ 'name' => 'itdatex/itdatex-e-invoice-output', 'pretty_version' => 'dev', 'version' => 'dev', 'reference' => null, 'type' => 'wordpress-plugin', 'install_path' => '', 'aliases' => [], 'dev' => false ];
    }
    public static function getRawData(): array { return []; }
    public static function getAllRawData(): array { return [ [] ]; }
    public static function reload($data): void {}
    public static function getInstalledPackagesByType(string $type): array { return []; }
}
