@param \eZ\Publish\API\Repository\Values\Content\VersionInfo[] $versions

@return array
359995
private function getVersionNumbers(array $versions): array
    {
        $versionNumbers = array_column($versions, 'versionNo');

        return array_combine($versionNumbers, array_fill_keys($versionNumbers, false));
    }
1325402
public function getGpgInfo($version)
    {
        $phpRelease = preg_replace('~^(\d+\.\d+)\.\d+$~', '\1', $this->resolveVersion($version));

        if (!isset($this->gpgKeys[$phpRelease])) {
            return [];
        }

        return $this->gpgKeys[$phpRelease];
    }
1357835
private function get_versions() {
            $versions = array();
            $versions['platform_version']             = get_bloginfo( 'version' );
            $versions['sdk_version']                  = $this->version;
            $versions['programming_language_version'] = phpversion();

            foreach ( $versions as $k => $version ) {
                if ( is_string( $versions[ $k ] ) && ! empty( $versions[ $k ] ) ) {
                    $versions[ $k ] = substr( $versions[ $k ], 0, 16 );
                }
            }

            return $versions;
        }
178622
private function sanitizeFilenames(array $files, $version)
    {
        $filesWithoutVersion = array_map(function ($file) use ($version) {
            if (preg_match('/\?' . preg_quote($version, '/') . '$/', $file)) {
                return substr($file, 0, -(strlen($version) + 1));
            }

            return $file;
        }, $files);

        return $filesWithoutVersion;
    }
394348
public static function sort(array $versions) : array
    {
        usort(
            $versions,
            function (Version $a, Version $b) {
                return VersionComparator::compare($a, $b);
            }
        );

        return $versions;
    }
1033814
public function getSearchedVersions()
    {
        $versions = array();
        
        if (!empty($_REQUEST['Versions'])) {
            if (is_array($_REQUEST['Versions'])) {
                $versions = Convert::raw2att($_REQUEST['Versions']);
                $versions = array_combine($versions, $versions);
            } else {
                $version = Convert::raw2att($_REQUEST['Versions']);
                $versions[$version] = $version;
            }
        }

        return $versions;
    }
398554
public function getVersions()
    {
        $versions = array();
        $log = $this->getResourceLog();
        foreach ($log as $entry) {
            $versions[] = (string) $entry->version;
        }

        return $versions;
    }
84054
private function filterByPhpVersion(array $versions)
    {
        $versionInfo = $this->getAvailableVersions();

        return array_filter($versions, function ($version) use ($versionInfo) {
            if (isset($versionInfo[$version]['php']['min'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['min'], '<')) {
                return false;
            } elseif (isset($versionInfo[$version]['php']['max'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['max'], '>')) {
                return false;
            }

            return true;
        });
    }
822147
private function getDescSortedVersions(array $packages): array
    {
        usort($packages, function (PackageInterface $a, PackageInterface $b) {
            return version_compare($b->getVersion(), $a->getVersion());
        });

        return $packages;
    }
1324053
public function removeImageVersions(EntityInterface $entity, array $versions, array $options = []) {
		$this->_checkImageVersions($entity->model, $versions);

		$result = [];
		foreach ($versions as $version) {
			$hash = $this->getImageVersionHash($entity->model, $version);
			$path = $this->pathBuilder()->fullPath($entity, ['fileSuffix' => '.' . $hash]);
			$result[$version] = [
				'status' => 'success',
				'hash' => $hash,
				'path' => $path
			];
			try {
				$this->getStorageAdapter($entity->adapter)->delete($path);
			} catch (\Exception $e) {
				$result[$version]['status'] = 'error';
				$result[$version]['error'] = $e->getMessage();
			}
		}

		return $result;
	}
822225
public function getPublishedDate($dates)
    {
        $defaults = [
            "revision" => [],
            "published" => null,
            "updated" => null,
            "created" => null,
        ];
        $dates = array_merge($defaults, $dates);
        
        if ($dates["revision"]) {
            return [t("Latest revision"), key($dates["revision"])];
        } elseif ($dates["published"]) {
            return [t("Published"), $dates["published"]];
        } elseif ($dates["updated"]) {
            return [t("Updated"), $dates["updated"]];
        } elseif ($dates["created"]) {
            return [t("Created"), $dates["created"]];
        }

        return [t("Missing pubdate."), null];
    }
398969
def handle_versions(repo, **kwargs):
    """"""
    log.info('versions: %s %s' %(repo, kwargs))
    if not hasattr(repo, 'versions'):
        return []
    return [v.serialize() for v in repo.versions(**kwargs)]
844294
protected function getReferencesValues($versionInfo, array $references, $step)
    {
        $refs = array();

        foreach ($references as $reference) {
            switch ($reference['attribute']) {
                case 'version_no':
                    $value = $versionInfo->versionNo;
                    break;
                case 'version_status':
                    $value = $this->versionStatusToHash($versionInfo->status);
                    break;
                default:
                    // NB: this will generate an error if the user tries to seta  ref to a field value
                    $value = reset(parent::getReferencesValues($versionInfo, array($references), $step));
            }

            $refs[$reference['identifier']] = $value;
        }

        return $refs;
    }
213018
protected function _getAvailableVersions($path, $version)
    {
        if (!is_dir($path)) {
            throw new Zend_Loader_Exception('Invalid ZF path provided');
        }

        $path       = rtrim($path, '/');
        $path       = rtrim($path, '\\');
        $versionLen = strlen($version);
        $versions   = array();
        $dirs       = glob("$path/*", GLOB_ONLYDIR);
        foreach ((array) $dirs as $dir) {
            $dirName = substr($dir, strlen($path) + 1);
            if (!preg_match('/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i', $dirName, $matches)) {
                continue;
            }

            $matchedVersion = $matches[1];

            if (('latest' == $version)
                || ((strlen($matchedVersion) >= $versionLen)
                    && (0 === strpos($matchedVersion, $version)))
            ) {
                $versions[$matchedVersion] = $dir . '/library';
            }
        }

        uksort($versions, 'version_compare');
        return $versions;
    }
319658
protected function getVersionConfig(string $version): array
    {
        if (!isset($this->versions[$version])) {
            throw new UnknownVersionNameException();
        }

        return $this->versions[$version];
    }
933979
private function getContext(VersionInfo $versionInfo)
    {
        return [
            'prioritizedLanguages' => $this->settings->prioritizedLanguages,
            'useAlwaysAvailable' => $this->settings->useAlwaysAvailable,
            'availableTranslations' => $versionInfo->languageCodes,
            'mainTranslation' => $versionInfo->contentInfo->mainLanguageCode,
            'alwaysAvailable' => $versionInfo->contentInfo->alwaysAvailable,
        ];
    }
426932
public function getVersionParts(string $version) : array
    {
        $dots = explode('.', $version, 2);

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

        return [$majorVer, $minorVer];
    }