Class MemoizingInflector
Decorator used to add memoization to previously inflected words
- Guzzle\Inflection\MemoizingInflector implements Guzzle\Inflection\InflectorInterface
Methods summary
-
public
__construct ( Guzzle\Inflection\InflectorInterface $inflector, int $maxCacheSize = 500 )
-
public
snake ( string $word )
Converts strings from camel case to snake case (e.g. CamelCase camel_case).
-
public
camel ( string $word )
Converts strings from snake_case to upper CamelCase
-
protected
pruneCache ( string $cache )
Prune one of the named caches by removing 20% of the cache if it is full
Methods detail
#
public
__construct( Guzzle\Inflection\InflectorInterface
$inflector, integer $maxCacheSize = 500 )
Parameters
- $inflector
Guzzle\Inflection\InflectorInterface
$inflector Inflector being decorated- $maxCacheSize
integer
$maxCacheSize Maximum number of cached items to hold per cache
Converts strings from camel case to snake case (e.g. CamelCase camel_case).
Parameters
- $word
string
$word Word to convert to snake case
Returns
string
Implementation of
Converts strings from snake_case to upper CamelCase
Parameters
- $word
string
$word Value to convert into upper CamelCase
Returns
string
Implementation of
Prune one of the named caches by removing 20% of the cache if it is full
Parameters
- $cache
string
$cache Type of cache to prune
Magic methods summary
Properties summary
protected
array
|
$cache |
#
Array of cached inflections |
protected
integer
|
$maxCacheSize |
#
Max entries per cache |
protected
|
$decoratedInflector |
#
Decorated inflector |