public static function getVersion(string $packageName) : string
{
$versions = iterator_to_array(self::getVersions(self::getComposerLockPath()));
if (!array_key_exists($packageName, $versions)) {
throw new \OutOfBoundsException('Required package "' . $packageName . '" is not installed: cannot detect its version');
}
return $versions[$packageName];
}