public static function convertDependencyVersion(AssetTypeInterface $assetType, $dependency, $version)
    {
        $containsHash = false !== strpos($version, '#');
        $version = str_replace('#', '', $version);
        $version = empty($version) ? '*' : trim($version);
        $searchVersion = str_replace(array(' ', '<', '>', '=', '^', '~'), '', $version);

        // sha version or branch version
        // sha size: 4-40. See https://git-scm.com/book/tr/v2/Git-Tools-Revision-Selection#_short_sha_1
        if ($containsHash && preg_match('{^[0-9a-f]{4,40}$}', $version)) {
            $version = 'dev-default#'.$version;
        } elseif ('*' !== $version && !Validator::validateTag($searchVersion, $assetType) && !static::depIsRange($version)) {
            $version = static::convertBrachVersion($assetType, $version);
        }

        return array($dependency, $version);
    }
public static function convertDependencyVersion(AssetTypeInterface $assetType, $dependency, $version)
    {
        $containsHash = false !== strpos($version, '#');
        $version = str_replace('#', '', $version);
        $version = empty($version) ? '*' : trim($version);
        $searchVersion = str_replace(array(' ', '<', '>', '=', '^', '~'), '', $version);

        // sha version or branch version
        // sha size: 4-40. See https://git-scm.com/book/tr/v2/Git-Tools-Revision-Selection#_short_sha_1
        if ($containsHash && preg_match('{^[0-9a-f]{4,40}$}', $version)) {
            $version = 'dev-default#'.$version;
        } elseif ('*' !== $version && !Validator::validateTag($searchVersion, $assetType) && !static::depIsRange($version)) {
            $version = static::convertBrachVersion($assetType, $version);
        }

        return array($dependency, $version);
    }
public static function convertDependencyVersion ( AssetTypeInterface $ assetType , $ dependency , $ version ) { $ containsHash = false !== strpos ( $ version , '#' ) ; $ version = str_replace ( '#' , '' , $ version ) ; $ version = empty ( $ version ) ? '*' : trim ( $ version ) ; $ searchVersion = str_replace ( array ( ' ' , '<' , '>' , '=' , '^' , '~' ) , '' , $ version ) ; // sha version or branch version // sha size: 4-40. See https://git-scm.com/book/tr/v2/Git-Tools-Revision-Selection#_short_sha_1 if ( $ containsHash && preg_match ( '{^[0-9a-f]{4,40}$}' , $ version ) ) { $ version = 'dev-default#' . $ version ; } elseif ( '*' !== $ version && ! Validator :: validateTag ( $ searchVersion , $ assetType ) && ! static :: depIsRange ( $ version ) ) { $ version = static :: convertBrachVersion ( $ assetType , $ version ) ; } return array ( $ dependency , $ version ) ; }
Convert the dependency version.

@param AssetTypeInterface $assetType  The asset type
@param string             $dependency The dependency
@param string             $version    The version

@return string[] The new dependency and the new version
Convert the dependency version .