src/VersionParser.php
public function normalizeBranch($name)
    {
        $name = trim($name);

        if (in_array($name, array('master', 'trunk', 'default'))) {
            return $this->normalize($name);
        }

        if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
            $version = '';
            for ($i = 1; $i < 5; ++$i) {
                $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x';
            }

            return str_replace('x', '9999999', $version) . '-dev';
        }

        return 'dev-' . $name;
    }
public function normalizeBranch($name)
    {
        $name = trim($name);

        if (in_array($name, array('master', 'trunk', 'default'))) {
            return $this->normalize($name);
        }

        if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
            $version = '';
            for ($i = 1; $i < 5; ++$i) {
                $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x';
            }

            return str_replace('x', '9999999', $version) . '-dev';
        }

        return 'dev-' . $name;
    }
public function normalizeBranch ( $ name ) { $ name = trim ( $ name ) ; if ( in_array ( $ name , array ( 'master' , 'trunk' , 'default' ) ) ) { return $ this -> normalize ( $ name ) ; } if ( preg_match ( '{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i' , $ name , $ matches ) ) { $ version = '' ; for ( $ i = 1 ; $ i < 5 ; ++ $ i ) { $ version .= isset ( $ matches [ $ i ] ) ? str_replace ( array ( '*' , 'X' ) , 'x' , $ matches [ $ i ] ) : '.x' ; } return str_replace ( 'x' , '9999999' , $ version ) . '-dev' ; } return 'dev-' . $ name ; }
Normalizes a branch name to be able to perform comparisons on it.

@param string $name

@return string
Normalizes a branch name to be able to perform comparisons on it .