You are here

protected static function ProjectInfoTrait::getExtensionVersion in Automatic Updates 7

Get the extension version.

Parameters

array $info: The extension's info.

Return value

string|null The version or NULL if undefined.

1 call to ProjectInfoTrait::getExtensionVersion()
ProjectInfoTrait::getInfos in ./ProjectInfoTrait.php
Returns an array of info files information of available extensions.

File

./ProjectInfoTrait.php, line 76

Class

ProjectInfoTrait
Provide a helper to get project info.

Code

protected static function getExtensionVersion(array $info) {
  $extension_name = $info['project'];
  if (isset($info['version']) && strpos($info['version'], '-dev') === FALSE) {
    return $info['version'];
  }
  watchdog('automatic_updates', 'Version cannot be located for @extension', [
    '@extension' => $extension_name,
  ], WATCHDOG_ERROR);
  return NULL;
}