src/Command/ValidateBranchAlias.php
public function validate($tag, $alias)
    {
        $simpleAlias  = preg_replace('~(\.x)?-dev~', '', $alias);
        $versionLevel = count(explode('.', $simpleAlias));
        $reducedTag   = preg_replace('~-.*$~', '', $tag);
        $reducedTag   = implode('.', array_slice(explode('.', $reducedTag), 0, $versionLevel));

        return version_compare($reducedTag, $simpleAlias, '<=');
    }
public function validate($tag, $alias)
    {
        $simpleAlias  = preg_replace('~(\.x)?-dev~', '', $alias);
        $versionLevel = count(explode('.', $simpleAlias));
        $reducedTag   = preg_replace('~-.*$~', '', $tag);
        $reducedTag   = implode('.', array_slice(explode('.', $reducedTag), 0, $versionLevel));

        return version_compare($reducedTag, $simpleAlias, '<=');
    }
public function validate ( $ tag , $ alias ) { $ simpleAlias = preg_replace ( '~(\.x)?-dev~' , '' , $ alias ) ; $ versionLevel = count ( explode ( '.' , $ simpleAlias ) ) ; $ reducedTag = preg_replace ( '~-.*$~' , '' , $ tag ) ; $ reducedTag = implode ( '.' , array_slice ( explode ( '.' , $ reducedTag ) , 0 , $ versionLevel ) ) ; return version_compare ( $ reducedTag , $ simpleAlias , '<=' ) ; }
Validate the given branch.

Returns true on success, the name of the offending tag on failure.

@param string $tag   The tag to check.

@param string $alias The alias for the given branch.

@return bool|string
Validate the given branch .