src/BoomCMS/Support/Str.php
public static function unique($initial, Closure $closure)
    {
        $append = 0;

        do {
            $string = ($append > 0) ? ($initial.$append) : $initial;
            $append++;
        } while ($closure($string) === false);

        return $string;
    }
public static function unique($initial, Closure $closure)
    {
        $append = 0;

        do {
            $string = ($append > 0) ? ($initial.$append) : $initial;
            $append++;
        } while ($closure($string) === false);

        return $string;
    }
public static function unique ( $ initial , Closure $ closure ) { $ append = 0 ; do { $ string = ( $ append > 0 ) ? ( $ initial . $ append ) : $ initial ; $ append ++ ; } while ( $ closure ( $ string ) === false ) ; return $ string ; }
Make a string unique.

Increments a numeric suffix until the given closure returns true.

@param string  $initial
@param Closure $closure

@return string
Make a string unique .