protected function getVersionsByModule($moduleName, $module)
{
if (!$module instanceof ApigilityProviderInterface && !$module instanceof ApigilityModuleInterface) {
throw new Exception\InvalidArgumentException('Expected ApigilityProviderInterface or ApigilityModuleInterface');
}
$path = $this->detectSourcePathFromModule($moduleName, $module);
$versions = [];
foreach (Glob::glob($path . DIRECTORY_SEPARATOR . 'V*') as $dir) {
if (preg_match('/\\V(?P<version>\\d+)$/', $dir, $matches)) {
$versions[] = (int) $matches['version'];
}
}
if (!$versions) {
return [1];
}
sort($versions);
return $versions;
}