If a name is not unique then append a suffix and numbering.
public static validateUnique ( $name, callable $function, string $suffix = null ) : string | ||
$name | The name to test. | |
$function | callable | A callback which should return true if the element is unique. Otherwise false. |
$suffix | string | A suffix to append between the name and numbering. |
return | string | A unique name. |