Get an array of deprecated releases.

@param int|null $treshold

@return int[]
323041
public function getDeprecatedReleases($treshold = null)
    {
        $releases = $this->getReleases();
        $treshold = $treshold ?: $this->config->get('remote.keep_releases');

        // Get first X valid releases
        $keep = $this->getValidReleases();
        $keep = array_slice($keep, 0, $treshold);

        // Compute diff
        $deprecated = array_diff($releases, $keep);
        $deprecated = array_values($deprecated);

        return $deprecated;
    }
204045
protected function renderRelease(Release $release)
	{
		$date = null;

		if ($release->getDate() !== null)
		{
			$date = $release->getDate()->format('Y-m-d');
		}

		return [
			'name' => $release->getName(),
			'link' => $release->getLink(),
			'linkName' => $release->getLinkName(),
			'date' => $date,
			'changes' => $release->getAllChanges(),
		];
	}
426932
public function getVersionParts(string $version) : array
    {
        $dots = explode('.', $version, 2);

        $majorVer = $dots[0];
        $minorVer = (isset($dots[1]) ? $dots[1] : '0');

        return [$majorVer, $minorVer];
    }
1223063
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerContentVersionTableMap::VERSION);

        return $this->getDealerContentVersions($criteria, $con);
    }
1027318
public function getModifiedFiles() {
		try {
			return $this->extractFromCommand ( 'git diff --name-status HEAD', function ($array) {
				$array = trim ( preg_replace ( '!\s+!', ' ', $array ) );
				return explode ( ' ', $array );
			} );
		} catch ( \Cz\Git\GitException $e ) {
			return [ ];
		}
	}
615028
public function getNoCache($sFilterValue) : array
    {
        if (empty($sFilterValue)) {
            return [];
        }

        $this->sValue = $sFilterValue;
        $arElementIDList = $this->getIDListFromDB();

        return $arElementIDList;
    }
588184
public function getRootVersions(BlockInterface $block)
    {
        $rootId = ($block instanceof BlockOwnerInterface) ? $block->getId() : $block->getOwner()->getId();

        /** @var BlockLogEntryRepository $repo */
        $repo = $this->em->getRepository('OpiferContentBundle:BlockLogEntry');
        $versions = $repo->findDistinctByRootId($rootId);

        return $versions;
    }
299521
public function get_versions() {
        if ($this->versions === null) {
            $policyid = $this->get_policy_id_filter();
            $versionid = $this->get_version_id_filter();
            $this->versions = [];
            foreach ($this->get_avaliable_policies() as $policy) {
                if ($policyid && $policy->id != $policyid) {
                    continue;
                }
                if ($versionid) {
                    if (array_key_exists($versionid, $policy->versions)) {
                        $this->versions[$versionid] = $policy->versions[$versionid];
                        break; // No need to keep searching.
                    }
                } else if ($policy->currentversion) {
                    $this->versions[$policy->currentversion->id] = $policy->currentversion;
                }
            }
        }
        return $this->versions;
    }
877745
public static function getPreviews($slug = null)
    {
        static::_initPreviews();

        if ($slug !== null) {
            if (isset(static::$_previews[$slug])) {
                return static::$_previews[$slug];
            }

            return [];
        }

        return static::$_previews;
    }
1002494
public function getVersions()
    {
        while (
            !empty($this->version) &&
            substr_count($this->version, '.') < 2
        ) {
            $this->version .= '.0';
        }
        // Remove part by part of the version.
        $result = array_merge(
            [$this->version],
            $this->explode($this->version, '.')
        );
        asort($result);
        usort($result, function ($a, $b) {
            // PHP 7: Switch to the <=> "Spaceship" operator
            return strlen($b) - strlen($a);
        });
        return $this->filterDuplicates($result);
    }
190438
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerFolderVersionTableMap::VERSION);

        return $this->getDealerFolderVersions($criteria, $con);
    }
644858
private function get_remote_versions() {
		$url = $this->get_versions_api_url();
		if ( empty( $url ) ) {
			return [];
		}
		$response = wp_remote_get( $url );
		if ( is_wp_error( $response ) ) {
			return array();
		}
		$response = wp_remote_retrieve_body( $response );

		if ( is_serialized( $response ) ) {
			$response = maybe_unserialize( $response );
		} else {
			$response = json_decode( $response );
		}

		if ( ! is_object( $response ) ) {
			return array();
		}
		if ( ! isset( $response->versions ) ) {
			return array();
		}

		$versions = array();
		foreach ( $response->versions as $key => $value ) {
			$versions[] = array(
				'version' => is_object( $value ) ? $value->version : $key,
				'url'     => is_object( $value ) ? $value->file : $value,
			);
		}

		return $versions;
	}
1229514
protected function getOptimisticLockingTraitHooks(): array
	{
		return
		[
			'beforeInsert' =>
			[
				function(array $values, $query): array
				{
					$lockingColumn = $this->getLockingColumn();

					$this->columns[$lockingColumn] = 1;

					return $values + [$lockingColumn => 1];
				},
			],
			'beforeUpdate' =>
			[
				function(array $values, $query): array
				{
					$lockingColumn = $this->getLockingColumn();

					return $values + [$lockingColumn => new Raw($query->getCompiler()->escapeIdentifier($lockingColumn) . ' + 1')];
				},
			],
		];
	}
433513
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(SkillVersionTableMap::COL_VERSION);

        return $this->getSkillVersions($criteria, $con);
    }
767422
public String getLastRelease(final Collection<String> versions) {
        final List<Version> sorted = versions.stream()
                .filter(Version::isValid)               // filter invalid input values
                .map(Version::make)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .filter(Version::isRelease)
                .sorted((v1, v2) -> {
                    try {
                        return v1.compare(v2);
                    } catch (IncomparableException e) {
                        return 0;
                    }
                })
                .collect(Collectors.toList());

        if(sorted.isEmpty()) {
            if(LOG.isWarnEnabled()) {
                LOG.warn(String.format("Cannot obtain last release from collection %s", versions.toString()));
            }
            return null;
        }

        return sorted.get(sorted.size() - 1).toString();
    }
219817
def get_releases(data, **kwargs):
    
    if "versions" in data:
        return sorted(data["versions"].keys(), key=lambda v: parse(v), reverse=True)
    return []
526547
public function getSortedRefs()
    {
        $versions = $this->versions;

        usort($versions, function (version $v1, version $v2) {


            return version::gt($v1, $v2) ? -1 : 1;
        });

        $versions = array_map(function (version $v) {


            return $v->getVersion();
        }, $versions);

        return array_merge($this->branches, $versions);
    }