public function gitBranch($branch)
    {
        $options = ['options' => ['regexp' => '/^[a-zA-Z0-9\/\+\._-]+$/']];
        if (filter_var($branch, FILTER_VALIDATE_REGEXP, $options) === false) {
            throw new \InvalidArgumentException(sprintf("Invalid characters found in git branch name '%s'. Use only letters, numbers, underscore, hyphen and forward slashes.", $branch));
        }

        return $branch;
    }
public function gitBranch($branch)
    {
        $options = ['options' => ['regexp' => '/^[a-zA-Z0-9\/\+\._-]+$/']];
        if (filter_var($branch, FILTER_VALIDATE_REGEXP, $options) === false) {
            throw new \InvalidArgumentException(sprintf("Invalid characters found in git branch name '%s'. Use only letters, numbers, underscore, hyphen and forward slashes.", $branch));
        }

        return $branch;
    }
public function gitBranch ( $ branch ) { $ options = [ 'options' => [ 'regexp' => '/^[a-zA-Z0-9\/\+\._-]+$/' ] ] ; if ( filter_var ( $ branch , FILTER_VALIDATE_REGEXP , $ options ) === false ) { throw new \ InvalidArgumentException ( sprintf ( "Invalid characters found in git branch name '%s'. Use only letters, numbers, underscore, hyphen and forward slashes." , $ branch ) ) ; } return $ branch ; }
Validate git branch name.

@param string $branch

@return string
Validate git branch name .