original_string: 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, '<=');
      }
code: 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, '<=');
      }
code_tokens: 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 , '<=' ) ; }
docstring: 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
docstring_tokens: Validate the given branch .