PreComputedInflector
in package
implements
InflectorInterface
Decorator used to add pre-computed inflection mappings to an inflector
Table of Contents
Interfaces
- InflectorInterface
- Inflector interface used to convert the casing of words
Properties
- $decoratedInflector : InflectorInterface
- $mapping : array<string|int, mixed>
Methods
- __construct() : mixed
- camel() : string
- Converts strings from snake_case to upper CamelCase
- snake() : string
- Converts strings from camel case to snake case (e.g. CamelCase camel_case).
Properties
$decoratedInflector
protected
InflectorInterface
$decoratedInflector
Decorated inflector
$mapping
protected
array<string|int, mixed>
$mapping
= array('snake' => array(), 'camel' => array())
Array of pre-computed inflections
Methods
__construct()
public
__construct(InflectorInterface $inflector[, array<string|int, mixed> $snake = array() ][, array<string|int, mixed> $camel = array() ][, bool $mirror = false ]) : mixed
Parameters
- $inflector : InflectorInterface
-
Inflector being decorated
- $snake : array<string|int, mixed> = array()
-
Hash of pre-computed camel to snake
- $camel : array<string|int, mixed> = array()
-
Hash of pre-computed snake to camel
- $mirror : bool = false
-
Mirror snake and camel reflections
camel()
Converts strings from snake_case to upper CamelCase
public
camel(string $word) : string
Parameters
- $word : string
-
Value to convert into upper CamelCase
Return values
stringsnake()
Converts strings from camel case to snake case (e.g. CamelCase camel_case).
public
snake(mixed $word) : string
Parameters
- $word : mixed
-
Word to convert to snake case