From 6388b27b7a8eadb1087dec2e7ccd245ce062aeae Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 8 Oct 2023 12:23:47 -0400 Subject: [PATCH] Removed unused \ncc\Utilities > Functions > convertToSemver() --- src/ncc/Utilities/Functions.php | 47 --------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/ncc/Utilities/Functions.php b/src/ncc/Utilities/Functions.php index 94a538f..0219a5e 100644 --- a/src/ncc/Utilities/Functions.php +++ b/src/ncc/Utilities/Functions.php @@ -415,53 +415,6 @@ return (new ConfigurationManager())->getProperty($property); } - /** - * Attempts to convert a weird version number to a standard version number - * - * @param $version - * @return string - */ - public static function convertToSemVer($version): string - { - if(stripos(strtolower($version), 'v') === 0) - { - $version = substr($version, 1); - } - - if(!Validate::version($version)) - { - $parts = explode('.', $version); - $major = (string)null; - $minor = (string)null; - $patch = (string)null; - - if(count($parts) >= 1) - { - $major = $parts[0]; - } - - if(count($parts) >= 2) - { - $minor = $parts[1]; - } - - if(count($parts) >= 3) - { - $patch = $parts[2]; - } - - // Assemble the SemVer compatible string - $version = "$major.$minor.$patch"; - } - - if(!Validate::version($version)) - { - return '1.0.0'; - } - - return $version; - } - /** * Attempts to cast the correct type of the given value *