Split the version.

@param string $version

@return array
332679
protected static function getSplittedVersion($version)
    {
        $version = static::cleanExtraVersion($version);
        $version = str_replace(array('*', 'x', 'X'), '9999999', $version);
        $exp = explode('.', $version);

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

        return array_combine($versionNumbers, array_fill_keys($versionNumbers, false));
    }
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;
    }
965125
protected function versionMatch($title, $version)
    {
        $title = strtolower($title);
        $version = strtolower($version);

        $version = str_replace(array('.', '-', '/'), ' ', $version);
        $versionParts = explode(' ', $version);

        $matches = array();

        foreach ($versionParts as $versionPart) {
            if (strlen($versionPart) >= 3 && stripos($title, $versionPart)) {
                $matches[] = $versionPart;
            }
        }

        $matches = count($matches);

        if ($matches > 0) {
            return $matches;
        } else {
            return false;
        }
    }
1257545
private static function fetchProtocolVersion(string $version): string
    {
        $v = substr($version, 5);

        if ($v === '2.0') {
            return '2';
        }

        // Fallback for values outside of valid protocol versions
        if (!in_array($v, static::$allowedVersions, true)) {
            return '1.1';
        }

        return $v;
    }
1112386
public static function getWindowsVersion(string $version)
    {
        $config = static::$windowsConfig;
        return \array_key_exists($version, $config) ? $config[$version] : $version;
    }
1202837
public static function split(string $name): array
    {
        $parts = explode(self::JSON_DELIMITER, $name, 2);
        $jsonPath = count($parts) === 2 ? explode(self::JSON_DELIMITER, end($parts)) : [];

        $relationParts = explode(self::RELATION_DELIMITER, $parts[0]);

        return [
            array_slice($relationParts, 0, -1),
            end($relationParts),
            $jsonPath,
        ];
    }
1260861
def _split_version_specifier(spec):
    """"""
    m = re.search(r'([<>=]?=?)?\s*([0-9.a-zA-Z]+)', spec)
    return m.group(2), m.group(1)
1307905
public function getConstraints($version)
    {
        if (!isset($this->constraints[$version])) {
            $this->constraints[$version] = $this->createConstraints($version);
        }

        return $this->constraints[$version];
    }
47145
public static function splitFileName($strFileName, $blnExtractVersion = true)
	{
		$arrParts = array();
		
		$intPosDot = strrpos($strFileName, ".");
		$fileName = substr($strFileName, 0, $intPosDot);
		$fileType = substr($strFileName, $intPosDot + 1);
		
		$hasVersion = false;
		$version = null;
		$versionMajor = null;
		$versionMinor = null;
		$versionPatch = null;
		
		if ($blnExtractVersion)
		{
			$arrFileNameParts = explode("_", $fileName);
			if (count($arrFileNameParts) >= 4)
			{
				$versionMajorTemp = $arrFileNameParts[count($arrFileNameParts) - 3];
				$versionMinorTemp = $arrFileNameParts[count($arrFileNameParts) - 2];
				$versionPatchTemp = $arrFileNameParts[count($arrFileNameParts) - 1];
				
				if (is_numeric($versionMajorTemp) && is_numeric($versionMinorTemp) && is_numeric($versionPatchTemp))
				{
					$hasVersion = true;
					$version = self::buildVersionForFileName($versionMajorTemp, $versionMinorTemp, $versionPatchTemp);
					$versionMajor = $versionMajorTemp;
					$versionMinor = $versionMinorTemp;
					$versionPatch = $versionPatchTemp;
					
					$fileName = substr($fileName, 0, strrpos($fileName, "_$version"));
				}
			}
		}
		
		$arrParts['fileName'] = $fileName;
		$arrParts['fileType'] = $fileType;
		$arrParts['hasVersion'] = $hasVersion;
		$arrParts['version'] = $version;
		$arrParts['versionMajor'] = $versionMajor;
		$arrParts['versionMinor'] = $versionMinor;
		$arrParts['versionPatch'] = $versionPatch;
		
		return $arrParts;
	}
1325118
private function resolveVersion($version)
    {
        if (isset($this->aliases[$version])) {
            $version = $this->aliases[$version];

            return $version;
        }

        return $version;
    }
540830
public static function split($fileName)
    {
        $ext = pathinfo($fileName);
        return [
            $ext['dirname'],
            $ext['filename'],
            empty($ext['extension']) ? '' : $ext['extension']
        ];
    }
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];
    }
633959
protected function cleanVersion($version)
    {
        //Clear anything that is in parentheses (and the parentheses themselves) - will clear started but unclosed ones too
        $cleanVer = preg_replace('/\([^)]+\)?/', '', $version);
        //Replace with a space any character which is NOT an alphanumeric, dot (.), hyphen (-), underscore (_) or space
        $cleanVer = preg_replace('/[^0-9.a-zA-Z_ -]/', ' ', $cleanVer);

        //Remove trailing and leading spaces
        $cleanVer = trim($cleanVer);

        //Remove trailing dot (.), hyphen (-), underscore (_)
        while (in_array(substr($cleanVer, -1), array('.', '-', '_'))) {
            $cleanVer = substr($cleanVer, 0, -1);
        }
        //Remove leading dot (.), hyphen (-), underscore (_) and character v
        while (in_array(substr($cleanVer, 0, 1), array('.', '-', '_', 'v', 'V'))) {
            $cleanVer = substr($cleanVer, 1);
        }

        //Remove double spaces if any
        while (strpos($cleanVer, '  ') !== false) {
            $cleanVer = str_replace('  ', ' ', $cleanVer);
        }

        return trim($cleanVer);
    }
1105073
public static function getSymfonyVersion($version)
    {
        return implode('.', \array_slice(array_map(static function ($val) {
            return (int) $val;
        }, explode('.', $version)), 0, 3));
    }
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;
    }
1185162
public function split() : array
    {
        $stlArray = $this->getStl()->toArray();
        $facets = $stlArray["facets"];

        $objArray = array();
        $vertex = $facets[0];
        unset($facets[0]);

        $current = 0;
        $objArray[$current] = array($vertex);
        while (count($facets) != 0) {
            $this->findNeighbour(
                $vertex,
                $objArray[$current],
                $facets
            );
            $vertex = array_pop($facets);
            $current++;
            if ($vertex) {
                $objArray[$current] = array($vertex);
            }
        }

        $stlObjects = array();
        foreach ($objArray as $key => $object) {
            $stlObjects[] = STL::fromArray(array(
                "name" => $this->getStl()->getSolidName() . $key,
                "facets" => $object
            ));
        }

        return $stlObjects;
    }