PHP Class Neos\Kickstarter\Utility\Inflector

Show file Open project: neos/flow-development-collection Class Usage Examples

Public Methods

Method Description
humanizeCamelCase ( string $camelCased, boolean $lowercase = false ) : string Convert a model class name like "BlogAuthor" or a field name like "blogAuthor" to a humanized version like "Blog author" for better readability.
pluralize ( string $word ) : string

Protected Methods

Method Description
spacify ( string $camelCased, string $glue = ' ' ) : string Splits a string at lowercase/uppcase transitions and insert the glue character in between.

Method Details

humanizeCamelCase() public method

Convert a model class name like "BlogAuthor" or a field name like "blogAuthor" to a humanized version like "Blog author" for better readability.
public humanizeCamelCase ( string $camelCased, boolean $lowercase = false ) : string
$camelCased string The camel cased value
$lowercase boolean Return lowercase value
return string The humanized value

pluralize() public method

public pluralize ( string $word ) : string
$word string The word to pluralize
return string The pluralized word

spacify() protected method

Splits a string at lowercase/uppcase transitions and insert the glue character in between.
protected spacify ( string $camelCased, string $glue = ' ' ) : string
$camelCased string
$glue string
return string