Create the route collections for the versions.

@param array $versions

@return void
165961
protected function createRouteCollections(array $versions)
    {
        foreach ($versions as $version) {
            if (! isset($this->routes[$version])) {
                $this->routes[$version] = new RouteCollector($this->parser, clone $this->generator);
            }
        }
    }
225414
public function create(array $paths)
    {
        $standards = new Standards();
        foreach ($paths as $path) {
            $standards->addStandard($this->standardFactory->create($path));
        }

        return $standards;
    }
465497
protected function loadFlowsFromPaths($version, $paths)
    {
        $this->currentLoadingVersion = $version;
        $finder = new Finder();
        $finder->files()->name('*.xml')->in($paths)->sortByName();

        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            $this->currentLoadingFile = $file;
            $this->currentFileSlug = self::slugify(str_replace('.xml', '', $this->currentLoadingFile->getRelativePathname()));
            $this->registeredNamesInFileCount = 1;
            $this->loadXMLFlows($file->getRealpath());
        }
    }
426896
private function handleVersions($versions)
    {
        foreach ($versions as $version => $info) {
            $announcement = $this->handleAnnouncement($version, $info);
            $date = $this->handleDate($info);

            $sources = [];

            foreach ($info['source'] as $source) {
                if (!isset($source['filename'])) {
                    continue;
                }

                foreach (['md5', 'sha256'] as $index) {
                    if (!isset($source[$index])) {
                        $source[$index] = null;
                    }
                }

                if (isset($source['date'])) {
                    unset($source['date']);
                }

                $sources[preg_replace('~.*\.~', '', $source['filename'])] = $source;
            }

            $versions[$version] = [
                'version' => $version,
                'aliases' => [],
                'announcement' => $announcement,
                'date' => date('Y-m-d', strtotime($date)),
                'source' => $sources,
                'museum' => isset($info['museum']) ? (boolean)$info['museum'] : false,
                'xdebug' => $this->getXdebugInfo($version),
                'gpg' => $this->getGpgInfo($version),
            ];
        }

        return $versions;
    }
92060
private function setVersionFromRequest(array $versions)
    {
        $this->setDefaultVersion($versions);

        foreach ($versions as $v) {
            if ($v->canParseRequest()) {
                $this->version = $v;
                break;
            }
        }
    }
987424
def create_versions(self, project_id, versions):
        

        for v in versions:
            self.create_version(project_id, v)
596884
public function processRoutes($routes)
	{
		if (is_null($this->openAPI->paths)) {
			$this->openAPI->paths = [];
		}

		foreach ($routes as $route) {
			$this->processRoute($route);
		}

	}
1259804
public function parseVersions($versions)
    {
        $retValue = array();
        if (is_string($versions)) {
            $retValue[] = array($versions, '>=');
        } elseif (is_array($versions)) {
            foreach ($versions as $version) {
                if (is_string($version)) {
                    $retValue[] = array($version, '>=');
                } elseif (is_array($version)) {
                    $retValue[] = array($version[0], $version[1]);
                } else {
                    throw new \InvalidArgumentException('Invalid version. Needs to be a string or an array.');
                }
            }
        } else {
            throw new \InvalidArgumentException('Invalid version. Needs to be a string or an array.');
        }

        return $retValue;
    }
1192812
private static function injectContainerToMigrations(ContainerInterface $container, array $versions) : void
    {
        foreach ($versions as $version) {
            $migration = $version->getMigration();
            if (! ($migration instanceof ContainerAwareInterface)) {
                continue;
            }

            $migration->setContainer($container);
        }
    }
69298
public function setRevisions(array $revisions)
    {
        $this->revisions = new ArrayCollection();

        /** @var \Rcm\Entity\Revision $revision */
        foreach ($revisions as $revision) {
            if (!$revision instanceof Revision) {
                throw new InvalidArgumentException(
                    "Invalid Revision passed in.  Unable to set array"
                );
            }

            $this->revisions->set($revision->getRevisionId(), $revision);
        }
    }
1248796
private static function usort(array $versions, $direction)
    {
        if (null === self::$versionParser) {
            self::$versionParser = new VersionParser();
        }

        $versionParser = self::$versionParser;
        $normalized = array();

        // Normalize outside of usort() scope for minor performance increase.
        // Creates an array of arrays: [[normalized, key], ...]
        foreach ($versions as $key => $version) {
            $normalized[] = array($versionParser->normalize($version), $key);
        }

        usort($normalized, function (array $left, array $right) use ($direction) {
            if ($left[0] === $right[0]) {
                return 0;
            }

            if (Comparator::lessThan($left[0], $right[0])) {
                return -$direction;
            }

            return $direction;
        });

        // Recreate input array, using the original indexes which are now in sorted order.
        $sorted = array();
        foreach ($normalized as $item) {
            $sorted[] = $versions[$item[1]];
        }

        return $sorted;
    }
970021
protected function registerRoutes(array $routes)
    {
        foreach ($routes as $route => $config) {
            $this->registerRoute($route, $config);
        }
    }
832514
protected function mergeOldRoutes($version)
    {
        if (! isset($this->oldRoutes)) {
            $this->oldRoutes = $this->router->getRoutes();
        }

        if (! isset($this->mergedRoutes[$version])) {
            $this->mergedRoutes[$version] = $this->routes[$version];

            foreach ($this->oldRoutes as $route) {
                $this->mergedRoutes[$version]->add($route);
            }
        }

        return $this->mergedRoutes[$version];
    }
1280189
public function forVersions(VersionsCollection $versions) : Version
    {
        Assert::that($versions->count())
            ->greaterThan(0, 'Cannot determine latest minor version from an empty collection');

        $stableVersions = $versions->matching(new class implements ConstraintInterface {
            public function assert(Version $version) : bool
            {
                return ! $version->isPreRelease();
            }
        });

        $versionsSortedDescending = $stableVersions->sortedDescending();

        /** @var Version $lastVersion */
        $lastVersion = array_values(iterator_to_array($versionsSortedDescending))[0];

        $matchingMinorVersions = $stableVersions
            ->matching(new CompositeConstraint(
                CompositeConstraint::OPERATOR_AND,
                new ComparisonConstraint(ComparisonConstraint::OPERATOR_LTE, $lastVersion),
                new ComparisonConstraint(
                    ComparisonConstraint::OPERATOR_GTE,
                    Version::fromString($lastVersion->getMajor() . '.' . $lastVersion->getMinor() . '.0')
                )
            ))
            ->sortedAscending();

        /** @var Version[] $matchingMinorVersionsAsArray */
        $matchingMinorVersionsAsArray = array_values(iterator_to_array($matchingMinorVersions));

        return $matchingMinorVersionsAsArray[0];
    }
1344652
function setServers(array $servers)
    {
        foreach($servers as &$svr)
        {
            self::formatServerConfig($svr);
        }
        $this->servers = $servers;
    }
982151
public function setPaths($paths)
    {
        $this->paths = $paths;
        self::$pathsMap[$this->namespace] = $this->paths;
    }
168742
public function setReleases($releases)
    {
        if (!is_array($releases)) {
            throw new \Exception("The releases parameter must be an array.");
        }
        if (isset($this->currentRelease)) {
            if (!isset($releases[$this->currentRelease['version']])) {
                unset($this->currentRelease);
            }
            else {
                // Make sure the info about the current release is updated properly.
                $this->currentRelease = $releases[$this->currentRelease['version']];
            }
        }
        $this->releases = $releases;
    }