Composer

InstalledVersions::getPrettyVersion()public staticWPSCache 1.0

Метод класса: InstalledVersions{}

Хуков нет.

Возвращает

Строку|null. If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present

Использование

$result = InstalledVersions::getPrettyVersion( $packageName );
$packageName(строка) (обязательный)
-

Код InstalledVersions::getPrettyVersion() WPSCache 1.9.2

public static function getPrettyVersion($packageName)
{
    foreach (self::getInstalled() as $installed) {
        if (!isset($installed['versions'][$packageName])) {
            continue;
        }

        if (!isset($installed['versions'][$packageName]['pretty_version'])) {
            return null;
        }

        return $installed['versions'][$packageName]['pretty_version'];
    }

    throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}