You are here

public function CdnBase::getVersions in Libraries CDN API 8

Return all available version(s).

Return value

array Return an array with available versions of the library.

Overrides CdnBaseInterface::getVersions

File

src/CdnBase.php, line 172
Class CdnBase.

Class

CdnBase
Class CdnBase.

Namespace

Drupal\libraries_cdn

Code

public function getVersions() {
  if (!$this
    ->isAvailable()) {
    return array();
  }
  $data = $this
    ->formatData(__FUNCTION__, $this
    ->query($this
    ->getURL(__FUNCTION__)));
  return array_filter(array_map(function ($v) {
    return isset($v['version']) ? $v['version'] : NULL;
  }, $data));
}