splits a version into the major and the minor version

@param string $version

@return string[]
426932
public function getVersionParts(string $version) : array
    {
        $dots = explode('.', $version, 2);

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

        return [$majorVer, $minorVer];
    }
1077433
protected function setVersion($version)
    {
        // Set version of browser
        $this->version = $version;

        // If major and minor versions hasn't been set
        // we'll set them by parsing version.
        //
        // If version doesn't contain a "." then we'll only
        // set the major version.
        if (empty($this->majorVersion) && strpos($version, '.') !== false) {
            // Split version by comma
            $version = explode('.', $version);

            // Set major and minor version
            $this->majorVersion = (int) isset($version[0]) ? $version[0] : 0;
            $this->minorVersion = (int) isset($version[1]) ? $version[1] : 0;
        } else {
            $this->majorVersion = (int) $version;
        }

        return $this;
    }
1105073
public static function getSymfonyVersion($version)
    {
        return implode('.', \array_slice(array_map(static function ($val) {
            return (int) $val;
        }, explode('.', $version)), 0, 3));
    }
1209289
public static function getStaticSummonerSpellsWithKeys( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_SUMMONERSPELLS, null, $locale, $version, self::STATIC_SUMMONERSPELLS_BY_KEY);
		$data = self::loadCachedStaticData($url);
		if (!$data)
		{
			self::getStaticSummonerSpells($locale, $version);
			$data = self::loadCachedStaticData($url);
		}
		return $data;
	}
319658
protected function getVersionConfig(string $version): array
    {
        if (!isset($this->versions[$version])) {
            throw new UnknownVersionNameException();
        }

        return $this->versions[$version];
    }
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;
    }
739742
private function splitString($string)
    {
        $result = array();
        for ($i = 0; $i < mb_strlen($string, "UTF-8"); ++$i) {
            $result[] = mb_substr($string, $i, 1, "UTF-8");
        }
        return $result;
    }
528447
protected function splitLine($line)
    {
        $result = [];
        foreach($this->fields as $field) {
            $result[] = mb_substr($line, $field['from'], $field['to'] - $field['from']);
        }
        return $result;
    }
1097193
private function arrayFlipRecursive(array $metaDataVersion): array
    {
        $transposedArray = [];

        foreach ($metaDataVersion as $key => $item) {
            if (is_numeric($key) && \is_string($item)) {
                $transposedArray[$this->convertKeyToLowerCase($item)] = $key;
            } elseif (\is_string($key) && \is_array($item)) {
                $transposedArray[$this->convertKeyToLowerCase($key)] = $this->arrayFlipRecursive($item);
            }
        }

        return $transposedArray;
    }
632818
public function setVersion($version)
    {
        // Set version
        $this->version = $version;

        // Split version into major, minor and patch
        $version = explode('.', $version);
        if (count($version) == 1) {
            array_push($version, 0, 0);
        }

        // Set major, minor and patch version
        $this->majorVersion = (int) isset($version[0]) ? $version[0] : 0;
        $this->minorVersion = (int) isset($version[1]) ? $version[1] : 0;
        $this->patchVersion = (int) isset($version[2]) ? $version[2] : 0;

        return $this;
    }
9182
private function getBranchAliases(ApiPackage\Version $version)
    {
        $extra = $version->getExtra();
        if (null !== $extra
            && isset($extra["branch-alias"])
            && is_array($extra["branch-alias"])
        ) {
            return $extra["branch-alias"];
        }

        return null;
    }
981994
private static function split(string $string): array
    {
        $chars = [];

        for ($i = 0; $i < strlen($string); $i++) {
            $chars[] = $string[$i];
        }

        return $chars;
    }
1080929
public static function convertVersionMetadata($version)
    {
        $version = str_replace(self::$cleanPatterns, '', $version);

        if (preg_match_all(
            self::createPattern('([a-zA-Z]+|(\-|\+)[a-zA-Z]+|(\-|\+)[0-9]+)'),
            $version,
            $matches,
            PREG_OFFSET_CAPTURE
        )) {
            list($type, $version, $end) = self::cleanVersion(strtolower($version), $matches);
            list($version, $patchVersion) = self::matchVersion($version, $type);

            $matches = array();
            $hasPatchNumber = preg_match('/[0-9]+\.[0-9]+|[0-9]+|\.[0-9]+$/', $end, $matches);
            $end = $hasPatchNumber ? $matches[0] : '1';

            if ($patchVersion) {
                $version .= $end;
            }
        }

        return static::cleanWildcard($version);
    }
1016471
public function importVersion($version)
    {
        return $this
            ->setMajor($version->getMajor())
            ->setMinor($version->getMinor())
            ->setPatch($version->getPatch())
            ->setPreRelease($version->getPreRelease())
            ->setBuild($version->getBuild());
    }
950431
protected function convertLegacySchemaVersion($version) {
    // Check to see if version is Semver (legacy format). Convert to expected
    // syntax. Luckily, there are a finite number of known legacy versions.
    // We check specifically for those.
    // E.g., 8.6.6 => 8006006.
    if (strpos($version, '.') !== FALSE) {
      str_replace('-beta1', '', $version);
      $semver_array = explode('.', $version);
      $semver_array[1] = str_pad($semver_array[1], 3, "0", STR_PAD_LEFT);
      $semver_array[2] = str_pad($semver_array[2], 3, "0", STR_PAD_LEFT);
      $version = implode('', $semver_array);
    }
    if (strpos($version, 'dev') !== FALSE) {
      $version = '0';
    }
    return $version;
  }
412352
protected function filterProtocolVersion($version)
    {
        if (!is_string($version) || !in_array($version, $this->protocols)) {
            throw new \InvalidArgumentException('The specified protocol is invalid.');
        }

        return $version;
    }
984117
protected static function splitConstraints($version)
    {
        $found   = [];
        $pattern = '/(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)/';

        foreach (preg_split('/\s*\|\|?\s*/', trim($version)) as $constraints) {
            $andConstraints = preg_split($pattern, $constraints);

            foreach ($andConstraints as $constraint) {
                $found[] = $constraint;
            }
        }

        return $found;
    }