Composer
InstalledVersions::getPrettyVersion()
Метод класса: 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() InstalledVersions::getPrettyVersion WPSCache 1.12.4
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'); }