Airship\Engine\Continuum\AutoUpdater::checkVersionSettings PHP Method

checkVersionSettings() protected method

Should this automatic update be permitted?
protected checkVersionSettings ( UpdateInfo $info, string $currentVersion ) : boolean
$info UpdateInfo
$currentVersion string
return boolean
    protected function checkVersionSettings(UpdateInfo $info, string $currentVersion) : bool
    {
        $state = State::instance();
        $nextVersion = $info->getVersion();
        $version = new Version($currentVersion);
        // If this isn't an upgrade at all, don't apply it.
        if (!$version->isUpgrade($nextVersion)) {
            return false;
        }
        if ($version->isMajorUpgrade($nextVersion)) {
            return !empty($state->universal['auto-update']['major']);
        }
        if ($version->isMinorUpgrade($nextVersion)) {
            return !empty($state->universal['auto-update']['minor']);
        }
        if ($version->isPatchUpgrade($nextVersion)) {
            return !empty($state->universal['auto-update']['patch']);
        }
        return false;
    }