Maintaining compatibility with different CASA versions is a pain.
494513
def modify_environment(self, env):
        """"""

        # Ugh. I don't see any way out of special-casing the RPM-based
        # installations ... which only exist on NRAO computers, AFAICT.
        # Hardcoding 64-bitness, hopefully that won't come back to bite me.
        is_rpm_install = self._rootdir.startswith('/usr/lib64/casapy/release/')

        def path(*args):
            return os.path.join(self._rootdir, *args)

        env['CASAROOT'] = path()
        env['CASAPATH'] = ' '.join([path(),
                                    os.uname()[0].lower(),
                                    'local',
                                    os.uname()[1]])

        if is_rpm_install:
            env['CASA_INSTALLATION_TYPE'] = 'rpm-installation'
            prepend_environ_path(env, 'PATH', '/usr/lib64/casa/01/bin')
            prepend_environ_path(env, 'PATH', path('bin'))
        else:
            env['CASA_INSTALLATION_TYPE'] = 'tar-installation'

            lib = 'lib64' if os.path.isdir(path('lib64')) else 'lib'
            # 4.3.1 comes with both python2.6 and python2.7???
            pydir = sorted(glob.glob(path(lib, 'python2*')))[-1]

            tcldir = path('share', 'tcl')
            if os.path.isdir(tcldir):
                env['TCL_LIBRARY'] = tcldir
            else:
                tcl_versioned_dirs = glob.glob(path('share', 'tcl*'))
                if len(tcl_versioned_dirs):
                    env['TCL_LIBRARY'] = tcl_versioned_dirs[-1]

            bindir = path(lib, 'casa', 'bin')
            if not os.path.isdir(bindir):
                bindir = path(lib, 'casapy', 'bin')
            prepend_environ_path(env, 'PATH', bindir)

            env['CASA_INSTALLATION_DIRECTORY'] = env['CASAROOT']
            env['__CASAPY_PYTHONDIR'] = pydir
            env['MATPLOTLIBRC'] = path('share', 'matplotlib')
            env['PYTHONHOME'] = env['CASAROOT']
            env['TK_LIBRARY'] = path('share', 'tk')
            env['QT_PLUGIN_PATH'] = path(lib, 'qt4', 'plugins')

            prepend_environ_path(env, 'LD_LIBRARY_PATH', path(lib))
            # should we overwite PYTHONPATH instead?
            prepend_environ_path(env, 'PYTHONPATH', os.path.join(pydir, 'site-packages'))
            prepend_environ_path(env, 'PYTHONPATH', os.path.join(pydir, 'heuristics'))
            prepend_environ_path(env, 'PYTHONPATH', pydir)

        return env
1232872
protected function checkPlatformVersion() 
    {
        // based on browscap.ini
        if ($this->_platform == self::PLATFORM_WINDOWS) 
        {
	        /*if( stripos($this->_agent, 'windows NT 7.1') !== false ) {
			    $this->_platform = self::PLATFORM_WINDOWS_7;
		    }
	        else*/
            if( stripos($this->_agent, 'windows NT 10.0') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_10;
            }
            elseif( stripos($this->_agent, 'windows NT 6.3') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_81;
                if( stripos($this->_agent, 'arm') !== false )
                {
                    $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
                }
            }
            elseif( stripos($this->_agent, 'windows NT 6.2') !== false ) 
            {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_8;
			    if( stripos($this->_agent, 'arm') !== false ) 
			    {
			        $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
			    }
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_7;
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_VISTA;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.2') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2003;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows XP') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2000;
		    }
		    elseif( stripos($this->_agent, 'windows NT 4.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_NT;
		    }
		    elseif( stripos($this->_agent, 'windows Me') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_ME;
		    }
		    elseif( stripos($this->_agent, 'windows 98') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_98;
		    }
		    elseif( stripos($this->_agent, 'windows 95') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_95;
		    }
        }

        if ($this->_platform == self::PLATFORM_WINDOWS_PHONE)
        {
            if ( stripos($this->_agent, 'Windows Phone OS') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone OS'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[3]);
            }
            elseif ( stripos($this->_agent, 'Windows Phone') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[2]);
            }
        }
        
        if ($this->_platform == self::PLATFORM_APPLE)
        {
            if ( stripos($this->_agent, 'Mac OS X') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_MACOSX;
            }
            if ( stripos($this->_agent, 'iPad') !== false 
              || stripos($this->_agent, 'iPod') !== false
              || stripos($this->_agent, 'iPhone') !== false) 
            {
                $this->_platformVersion = self::PLATFORM_IOSX;
            }
        }
	    elseif( stripos($this->_agent, 'Warp 4') !== false ) {
		    $this->_platformVersion = self::PLATFORM_WARP4;
	    }
    }
795950
static InstallException create(RepositoryResolutionException e, Collection<String> assetNames, File installDir, boolean installingAsset,
                                   boolean isOpenLiberty) {
        Collection<MissingRequirement> allRequirementsNotFound = e.getAllRequirementsResourcesNotFound();
        Collection<MissingRequirement> dependants = new ArrayList<MissingRequirement>(allRequirementsNotFound.size());
        for (MissingRequirement f : allRequirementsNotFound) {
            /**
             * make sure it's not invalid asset names entered
             */
            if (!assetNames.contains(f.getRequirementName())) {
                dependants.add(f);
            }
        }

        /**
         * not valid for current product case or dependency not applicable
         */

        MissingRequirement missingRequirementWithMaxVersion = null;
        String newestVersion = null;
        for (MissingRequirement mr : allRequirementsNotFound) {
            if (missingRequirementWithMaxVersion == null)
                missingRequirementWithMaxVersion = mr;
            String r = mr.getRequirementName();
            if (r.contains("productInstallType") ||
                r.contains("productEdition") ||
                r.contains("productVersion")) {

                Pattern validNumericVersionOrRange = Pattern.compile("\\d+\\.\\d+\\.\\d+\\.\\d+");
                Matcher matcher = validNumericVersionOrRange.matcher(r);
                String version = null;
                while (matcher.find()) {
                    version = matcher.group();
                    break;
                }
                List productMatchers = SelfExtractor.parseAppliesTo(mr.getRequirementName());
                wlp.lib.extract.ReturnCode validInstallRC = SelfExtractor.validateProductMatches(installDir, productMatchers);
                String currentEdition = "";
                if (validInstallRC.getMessageKey().equals("invalidVersion") || validInstallRC.getMessageKey().equals("invalidEdition")) {
                    int productEdition = 2;
                    if (validInstallRC.getMessageKey().equals("invalidEdition")) {
                        productEdition = 0;
                    }
                    currentEdition = (String) validInstallRC.getParameters()[productEdition];
                }
                if (!!!currentEdition.equals("Liberty Early Access")) {
                    if (isNewerVersion(version, newestVersion, false)) {
                        missingRequirementWithMaxVersion = mr;
                        newestVersion = version;
                    }
                } else {
                    if (isNewerVersion(version, newestVersion, true)) {
                        missingRequirementWithMaxVersion = mr;
                        newestVersion = version;
                    }
                }

            }
        }

        /**
         * missing dependent case, keep the current message
         */
        if (dependants.size() > 0) {
            String missingRequirement = missingRequirementWithMaxVersion.getRequirementName();
            if (!missingRequirement.contains(";")
                && !missingRequirement.contains("productInstallType")
                && !missingRequirement.contains("productEdition")
                && !missingRequirement.contains("productVersion")) {
                String assetsStr = "";
                String feature = missingRequirement;
                InstallException ie = null;
                if (assetNames.size() == 1) {
                    assetsStr = assetNames.iterator().next();
                    ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_ASSET_MISSING_DEPENDENT" : "ERROR_MISSING_DEPENDENT",
                                                                               assetsStr,
                                                                               feature),
                                e);
                } else if (assetNames.size() > 1) {
                    assetsStr = assetNames.toString();
                    ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_ASSET_MISSING_MULTIPLE_DEPENDENT" : "ERROR_MISSING_MULTIPLE_DEPENDENT",
                                                                               assetsStr,
                                                                               feature),
                                e);
                }

                ie.setData(assetsStr, feature);

                return ie;

            }
        }

        if (missingRequirementWithMaxVersion.getRequirementName().contains("productInstallType") ||
            missingRequirementWithMaxVersion.getRequirementName().contains("productEdition") ||
            missingRequirementWithMaxVersion.getRequirementName().contains("productVersion")) {
            @SuppressWarnings("rawtypes")
            List productMatchers = SelfExtractor.parseAppliesTo(missingRequirementWithMaxVersion.getRequirementName());
            String feature = RepositoryDownloadUtil.getAssetNameFromMassiveResource(missingRequirementWithMaxVersion.getOwningResource());
            String errMsg = "";
            if (InstallUtils.containsIgnoreCase(assetNames, feature)) {
                errMsg = validateProductMatches(feature, productMatchers, installDir, installingAsset);

            } else {
                String assetsStr = assetNames.size() == 1 ? assetNames.iterator().next() : InstallUtils.getFeatureListOutput(assetNames);
                errMsg = validateProductMatches(assetsStr, feature, productMatchers, installDir, installingAsset);
            }
            if (!errMsg.isEmpty()) {
                return create(errMsg, e, InstallException.NOT_VALID_FOR_CURRENT_PRODUCT);
            }
        }

        InstallException ie;
        if (isOpenLiberty) {
            ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES_FOR_OPEN_LIBERTY",
                                                                       InstallUtils.getFeatureListOutput(assetNames)),
                        e);
        } else {
            ie = create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(installingAsset ? "ERROR_FAILED_TO_RESOLVE_ASSETS" : "ERROR_FAILED_TO_RESOLVE_FEATURES",
                                                                       InstallUtils.getFeatureListOutput(assetNames)),
                        e);
        }

        ie.setData(assetNames);

        return ie;
    }
419911
public function addVersion($con = null)
    {
        $this->enforceVersion = false;

        $version = new ChildDealerContactVersion();
        $version->setId($this->getId());
        $version->setDealerId($this->getDealerId());
        $version->setIsDefault($this->getIsDefault());
        $version->setCreatedAt($this->getCreatedAt());
        $version->setUpdatedAt($this->getUpdatedAt());
        $version->setVersion($this->getVersion());
        $version->setVersionCreatedAt($this->getVersionCreatedAt());
        $version->setVersionCreatedBy($this->getVersionCreatedBy());
        $version->setDealerContact($this);
        if (($related = $this->getDealer($con)) && $related->getVersion()) {
            $version->setDealerIdVersion($related->getVersion());
        }
        if ($relateds = $this->getDealerContactInfos($con)->toKeyValue('Id', 'Version')) {
            $version->setDealerContactInfoIds(array_keys($relateds));
            $version->setDealerContactInfoVersions(array_values($relateds));
        }
        $version->save($con);

        return $version;
    }
870068
def patch_compat(config):
	
	if 'web_host' in config:
		config['host'] = config.pop('web_host')
	if 'web_port' in config:
		config['port'] = config.pop('web_port')
201553
@Fix(org.eclipse.xtext.xbase.validation.IssueCodes.INCOMPATIBLE_RETURN_TYPE)
	public void fixIncompatibleReturnType(final Issue issue, IssueResolutionAcceptor acceptor) {
		ReturnTypeReplaceModification.accept(this, issue, acceptor);
	}
763072
def enforce_versioning(force=False):
    """"""
    connect_str, repo_url = get_version_data()
    LOG.warning("Your database uses an unversioned benchbuild schema.")
    if not force and not ui.ask(
            "Should I enforce version control on your schema?"):
        LOG.error("User declined schema versioning.")
        return None
    repo_version = migrate.version(repo_url, url=connect_str)
    migrate.version_control(connect_str, repo_url, version=repo_version)
    return repo_version
795702
private void setFromEnv() throws DevFailed {
        String env = TangoEnv.getTangoHost();
        assert env != null;
        if (!env.contains(":"))
            Except.throw_connection_failed("TangoApi_TANGO_HOST_NOT_SET",
                    "Unknown \"TANGO_HOST\" property " + env,
                    "TangoUrl.setFromEnv()");
        String[] array = ApiUtil.parseTangoHost(env);
        host = array[0];
        strPort = array[1];
        port = Integer.parseInt(strPort);
        envRead = true;
        fromEnv = true;
    }
373324
function(version, cb) {
  var version_path = join(paths.versions, version),
      opts         = { env: process.env, cwd: version_path },
      args         = ['config', 'activate'];

  opts.env.UPGRADING_FROM = common.version;

  if (process.platform == 'win32') {
    var bin  = join(version_path, 'bin', 'node.exe');
    args     = [join('lib', 'conf', 'cli.js')].concat(args);
  } else {
    var bin  = join(version_path, 'bin', paths.bin);
  }

  run_synced(bin, args, opts, function(err, code) {
    if (!err && code === 0) return cb();

    shared.log('Failed. Rolling back!');

    // something went wrong while upgrading.
    // remove new package & undo pre_uninstall
    shared.version_manager.remove(version, function(er) {
      cb(er || err);
    });
  });
}
1169269
public function matchPackageVersions($availableVersions, $wantedVersion)
    {
        $m = null;
        if (preg_match('/^(\d+(?:\.\d+)*)(?:dev|alpha|a|beta|b|rc)/i', $wantedVersion, $m)) {
            $wantedVersionBase = $m[1];
        } else {
            $wantedVersionBase = $wantedVersion;
        }
        $wantedVersionComparable = preg_replace('/^(.*?\d)(\.0+)+$/', '\1', $wantedVersionBase);
        $result = null;
        $availableVersions = $this->sortPackageVersions($availableVersions, false);
        foreach ($availableVersions as $availableVersion) {
            if ($result === null) {
                $result = $availableVersion;
            }
            if (strpos($availableVersion, PackageVersionEntity::DEV_PREFIX) === 0) {
                $availableVersionBase = substr($availableVersion, strlen(PackageVersionEntity::DEV_PREFIX));
                $availableVersionIsDev = true;
            } else {
                $availableVersionBase = $availableVersion;
                $availableVersionIsDev = false;
            }
            $availableVersionComparable = preg_replace('/^(.*?\d)(\.0+)+$/', '\1', $availableVersionBase);
            if ($availableVersionIsDev) {
                $availableVersionIsDev .= str_repeat('.' . PHP_INT_MAX, 6);
            }
            $cmp = version_compare($availableVersionComparable, $wantedVersionComparable);
            if ($cmp > 0) {
                if ($availableVersionIsDev && strpos($availableVersionBase . '.', $wantedVersionBase . '.') === 0) {
                    $result = $availableVersion;
                }
                break;
            }
            $result = $availableVersion;
            if ($cmp === 0) {
                break;
            }
        }

        return $result;
    }
392229
function configureLocalBrowsers (config) {
  var isMac = /^darwin/.test(process.platform);
  var isWindows = /^win/.test(process.platform);
  var isLinux = !isMac && !isWindows;

  if (isMac) {
    config.browsers = ['Firefox', 'Chrome', 'Safari'];
  }
  else if (isLinux) {
    config.browsers = ['Firefox', 'ChromeHeadless'];
  }
  else if (isWindows) {
    config.browsers = ['Firefox', 'Chrome', 'IE9', 'IE10', 'IE'];

    // NOTE: IE 6, 7, 8 are not supported by Chai
    config.customLaunchers = {
      IE9: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE9'
      },
      IE10: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE10'
      }
    };
  }
}
1049206
function matchVersions() {
		var rl = regObjArr.length;
		if (rl > 0) {
			for (var i = 0; i < rl; i++) { // for each registered object element
				var id = regObjArr[i].id;
				var cb = regObjArr[i].callbackFn;
				var cbObj = {success:false, id:id};
				if (ua.pv[0] > 0) {
					var obj = getElementById(id);
					if (obj) {
						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
							setVisibility(id, true);
							if (cb) {
								cbObj.success = true;
								cbObj.ref = getObjectById(id);
								cb(cbObj);
							}
						}
						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
							var att = {};
							att.data = regObjArr[i].expressInstall;
							att.width = obj.getAttribute("width") || "0";
							att.height = obj.getAttribute("height") || "0";
							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
							// parse HTML object param element's name-value pairs
							var par = {};
							var p = obj.getElementsByTagName("param");
							var pl = p.length;
							for (var j = 0; j < pl; j++) {
								if (p[j].getAttribute("name").toLowerCase() != "movie") {
									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
								}
							}
							showExpressInstall(att, par, id, cb);
						}
						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
							displayAltContent(obj);
							if (cb) { cb(cbObj); }
						}
					}
				}
				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
					setVisibility(id, true);
					if (cb) {
						var o = getObjectById(id); // test whether there is an HTML object element or not
						if (o && typeof o.SetVariable != UNDEF) { 
							cbObj.success = true;
							cbObj.ref = o;
						}
						cb(cbObj);
					}
				}
			}
		}
	}
43257
function () {
        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        /**
         * <b>Deprecated, use aria.core.Browser.ua instead.</b>
         *
         * <p>
         * The user agent string.
         * </p>
         *
         * @type String
         * @deprecated use aria.core.Browser.ua instead
         */
        this.ua = null;
         */

        /**
         * Previous orientation value to check if event should be raised (value changed or not).
         * @type Boolean
         * @private
         */
        this._previousIsPortrait = this.isPortrait(true);

        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        this._deprecatedProperties = []; // for init to process well
         */

        /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
        var properties = [
            {
                name: "ua",
                alternative: "aria.core.Browser.ua"
            },

            {
                name: "isMobile",
                type: "method",
                underlying: "isPhone"
            },
            {
                name: "isPhoneGap",
                type: "method",
                underlying: {
                    name: "isPhoneGap",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            },
            {
                name: "is2DTransformCapable",
                type: "method",
                underlying: {
                    name: "is2DTransformCapable",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            },
            {
                name: "is3DTransformCapable",
                type: "method",
                underlying: {
                    name: "is3DTransformCapable",
                    container: ariaCoreBrowser,
                    containerName: "aria.core.Browser"
                }
            }
        ];

        var deprecatedProperties = [];
        var isString = ariaUtilsType.isString;
        ariaUtilsArray.forEach(properties, function(property) {
            // ------------------------------------------------ property factory

            if (ariaUtilsType.isString(property)) {
                property = {name: property};
            }

            // ------------------------------------------------------------ name

            var name = property.name;

            // ------------------------------------------------------------ type

            var type = property.type;

            if (type == null) {
                type = "attribute";
            }

            property.type = type;

            // ----------------------------------------------- underlying method

            var possibleAlternative;

            if (type == "method") {
                var underlying = property.underlying;

                if (isString(underlying)) {
                    underlying = {name: underlying};
                }

                var underlyingName = underlying.name;

                var underlyingContainer = underlying.container;
                if (underlyingContainer == null) {
                    underlyingContainer = this;
                }
                underlying.container = underlyingContainer;

                var underlyingContainerName = underlying.containerName;

                // -------------------------------------------------------------

                possibleAlternative = "";
                if (underlyingContainerName != null) {
                    possibleAlternative += underlyingContainerName + ".";
                }
                possibleAlternative += underlyingName;

                underlying = function() {
                    return underlyingContainer[underlyingName].apply(underlyingContainer, arguments);
                };

                property.underlying = underlying;
            }

            // ----------------------------------------------------- alternative

            var alternative = property.alternative;

            if (alternative == null && possibleAlternative != null) {
                alternative = possibleAlternative;
            }

            property.alternative = alternative;

            // --------------------------------------------------- extrapolation

            var loggingMessage;
            var loggingMessageArguments = [name];

            if (alternative != null) {
                loggingMessage = type == "attribute" ? "DEPRECATED_REPLACED_PROPERTY" : "DEPRECATED_REPLACED_METHOD";
                loggingMessageArguments.push(alternative);
            } else {
                loggingMessage = type == "attribute" ? "DEPRECATED_REMOVED_PROPERTY" : "DEPRECATED_REMOVED_METHOD";
            }

            property.loggingMessage = this[loggingMessage];
            property.loggingMessageArguments = loggingMessageArguments;

            // ---------------------------------------------------------- result

            deprecatedProperties.push(property);
        }, this);

        this._deprecatedProperties = deprecatedProperties;
        this.__deprecateProperties();
         */

        this.init();
    }
767030
def _back_compatible_gemini(conf_files, data):
    
    if vcfanno.is_human(data, builds=["37"]):
        for f in conf_files:
            if f and os.path.basename(f) == "gemini.conf" and os.path.exists(f):
                with open(f) as in_handle:
                    for line in in_handle:
                        if line.startswith("file"):
                            fname = line.strip().split("=")[-1].replace('"', '').strip()
                            if fname.find(".tidy.") > 0:
                                return install.get_gemini_dir(data)
    return None
412766
def fail_if_publish_binary_not_installed(binary, publish_target, install_link):
    """"""
    if not shutil.which(binary):
        click.secho(
            "Publishing to {publish_target} requires {binary} to be installed and configured".format(
                publish_target=publish_target, binary=binary
            ),
            bg="red",
            fg="white",
            bold=True,
            err=True,
        )
        click.echo(
            "Follow the instructions at {install_link}".format(
                install_link=install_link
            ),
            err=True,
        )
        sys.exit(1)
816835
private function areNullableReturnTypesSupported(): bool
    {
        $testVersion = trim(PHPCompatibility\PHPCSHelper::getConfigData('testVersion') ?: '');
        if (!$testVersion) {
            return false;
        }

        preg_match('`^(\d+\.\d+)(?:\s*-\s*(?:\d+\.\d+)?)?$`', $testVersion, $matches);
        $min = $matches[1] ?? null;

        return $min && version_compare($min, '7.1', '>=');
    }
1300776
private function avoidApprovalOverlapping()
    {
        if (!$this->isApproved()) {
            return;
        }
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();
        $dh = $app->make('helper/date');
        $qbBase = $db->createQueryBuilder();
        $x = $qbBase->expr();
        $qbBase->update('CollectionVersions', 'cv')
            ->andWhere($x->eq('cv.cvIsApproved', 1))
            ->andWhere($x->eq('cv.cID', $qbBase->createNamedParameter($this->getCollectionID())))
            ->andWhere($x->neq('cv.cvID', $qbBase->createNamedParameter($this->getVersionID())))
        ;
        $startDate = $this->getPublishDate() ?: null;
        $endDate = $this->getPublishEndDate() ?: null;
        $changes = [];

        // Let's unapprove other approved collection versions whose approval time is all within this collection version
        if ($startDate !== null && $endDate !== null) {
            // This collection version is published from $startDate until $endDate:
            // let's unapprove the other collection versions that start at or after $startDate and end at or before $endDate
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvIsApproved', 0)
                ->andWhere($x->isNotNull('cv.cvPublishDate'))
                ->andWhere($x->gte('cv.cvPublishDate', $qb->createNamedParameter($startDate)))
                ->andWhere($x->isNotNull('cv.cvPublishEndDate'))
                ->andWhere($x->lte('cv.cvPublishEndDate', $qb->createNamedParameter($endDate)))
                ->execute()
            ;
        } elseif ($startDate !== null) {
            // This collection version is published from $startDate until forever:
            // let's unapprove the other collection versions that start at or after $startDate
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvIsApproved', 0)
                ->andWhere($x->isNotNull('cv.cvPublishDate'))
                ->andWhere($x->gte('cv.cvPublishDate', $qb->createNamedParameter($startDate)))
                ->execute()
            ;
        } elseif ($endDate !== null) {
            // This collection version is published from ever until $endDate:
            // let's unapprove the other collection versions that end at or before $endDate
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvIsApproved', 0)
                ->andWhere($x->isNotNull('cv.cvPublishEndDate'))
                ->andWhere($x->lte('cv.cvPublishEndDate', $qb->createNamedParameter($endDate)))
                ->execute()
            ;
        } else {
            // This collection version is published from ever and until forever:
            // let's unapprove all the other collection versions
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvIsApproved', 0)
                ->execute()
            ;
        }

        if ($endDate != null) {
            // This collection version is published until $endDate:
            // set the initial date/time of the other collection versions that start and end at or before $endDate
            $minOthersStartDate = $endDate ? $dh->toDB(strtotime($endDate) + 1) : null;
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvPublishDate', $qb->createNamedParameter($minOthersStartDate))
                ->andWhere($x->orX(
                    $x->isNull('cv.cvPublishDate'),
                    $x->lte('cv.cvPublishDate', $qb->createNamedParameter($endDate))
                ))
                ->andWhere($x->orX(
                    $x->isNull('cv.cvPublishEndDate'),
                    $x->gte('cv.cvPublishEndDate', $qb->createNamedParameter($minOthersStartDate))
                ))
                ->execute()
            ;
        }

        if ($startDate !== null) {
            // This collection version is published from $startDate
            // set the final date/time of the other collection versions that end at or after $startDate
            $maxOthersEndDate = $startDate ? $dh->toDB(strtotime($startDate) - 1) : null;
            $qb = clone $qbBase;
            $changes[] = $qb
                ->set('cv.cvPublishEndDate', $qb->createNamedParameter($maxOthersEndDate))
                ->andWhere($x->orX(
                    $x->isNull('cv.cvPublishEndDate'),
                    $x->gte('cv.cvPublishEndDate', $qb->createNamedParameter($startDate))
                ))
                ->andWhere($x->orX(
                    $x->isNull('cv.cvPublishDate'),
                    $x->lte('cv.cvPublishDate', $qb->createNamedParameter($maxOthersEndDate))
                ))
                ->execute()
            ;
        }
        if (count(array_filter($changes)) > 0) {
            $this->refreshCache();
        }
    }