Composer

InstalledVersions::getReference()public staticWPSCache 1.0

Method of the class: InstalledVersions{}

No Hooks.

Return

String|null. If the package is being replaced or provided but is not really installed, null will be returned as reference

Usage

$result = InstalledVersions::getReference( $packageName );
$packageName(string) (required)
-

InstalledVersions::getReference() code WPSCache 1.9.2

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

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

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

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