public static function validateTag($tag, AssetTypeInterface $assetType, VersionParser $parser = null)
    {
        if (\in_array($tag, array('master', 'trunk', 'default'), true)) {
            return false;
        }

        if (null === $parser) {
            $parser = new VersionParser();
        }

        try {
            $tag = $assetType->getVersionConverter()->convertVersion($tag);
            $tag = $parser->normalize($tag);
        } catch (\Exception $e) {
            $tag = false;
        }

        return $tag;
    }
public static function validateTag($tag, AssetTypeInterface $assetType, VersionParser $parser = null)
    {
        if (\in_array($tag, array('master', 'trunk', 'default'), true)) {
            return false;
        }

        if (null === $parser) {
            $parser = new VersionParser();
        }

        try {
            $tag = $assetType->getVersionConverter()->convertVersion($tag);
            $tag = $parser->normalize($tag);
        } catch (\Exception $e) {
            $tag = false;
        }

        return $tag;
    }
public static function validateTag ( $ tag , AssetTypeInterface $ assetType , VersionParser $ parser = null ) { if ( \ in_array ( $ tag , array ( 'master' , 'trunk' , 'default' ) , true ) ) { return false ; } if ( null === $ parser ) { $ parser = new VersionParser ( ) ; } try { $ tag = $ assetType -> getVersionConverter ( ) -> convertVersion ( $ tag ) ; $ tag = $ parser -> normalize ( $ tag ) ; } catch ( \ Exception $ e ) { $ tag = false ; } return $ tag ; }
Validates the tag.

@param string             $tag
@param AssetTypeInterface $assetType
@param null|VersionParser $parser

@return false|string
Validates the tag .