public function getNextVersion()
{
$versionInformation = $this->getPluginVersionInformation();
if (!count($versionInformation)) {
return '1.0.0';
}
$versions = array_keys($versionInformation);
$latestVersion = end($versions);
$versionNumbers = [];
if (!preg_match('/^([0-9]+)\\.([0-9]+)\\.([0-9]+)$/', $latestVersion, $versionNumbers)) {
throw new SystemException(sprintf('Cannot parse the latest plugin version number: %s.', $latestVersion));
}
return $versionNumbers[1] . '.' . $versionNumbers[2] . '.' . ($versionNumbers[3] + 1);
}