You are here

public function Dummy::getVersions in Libraries CDN API 7

Return all available version(s).

Return value

array Return an array with available versions of the library.

Overrides CDNBase::getVersions

File

modules/libraries_cdn_example_plugin/src/Plugin/LibrariesCDN/Dummy.php, line 129
Plugin: jsDelivr.

Class

Dummy
Class Dummy.

Namespace

Drupal\libraries_cdn_example_plugin\Plugin\LibrariesCDN

Code

public function getVersions() {
  $data = array();
  $count_version = mt_rand(1, 5);
  for ($i = 0; $i < $count_version; $i++) {
    $major = mt_rand(1, 10);
    $minor = mt_rand(1, 1000);
    $data['versions'][] = $major . '.' . $minor;
  }
  return array_filter($data);
}