PHP Class Vanilla\Utility\NameScheme

Show file Open project: vanilla/vanilla

Public Methods

Method Description
convert ( string $name ) : string Convert a name into this name spec.
convertArrayKeys ( array $array, array $keysSkipRecursion = [] ) : array Recursively convert all of the array keys in an array to this name scheme.
valid ( string $name ) : boolean Test that a name is valid for this scheme.

Method Details

convert() abstract public method

Convert a name into this name spec.
abstract public convert ( string $name ) : string
$name string The name to convert to this scheme.
return string Returns the new name as a string.

convertArrayKeys() public method

Recursively convert all of the array keys in an array to this name scheme.
public convertArrayKeys ( array $array, array $keysSkipRecursion = [] ) : array
$array array The array to convert.
$keysSkipRecursion array Skip recursion for the following keys.
return array Returns the converted array.

valid() public method

Test that a name is valid for this scheme.
public valid ( string $name ) : boolean
$name string The name to test.
return boolean Returns **true** if the name is valid for this spec or **false** otherwise.