\Guzzle\InflectionMemoizingInflector

Decorator used to add memoization to previously inflected words

Summary

Methods
Properties
Constants
__construct()
snake()
camel()
No public properties found
No constants found
pruneCache()
$cache
$maxCacheSize
$decoratedInflector
N/A
No private methods found
No private properties found
N/A

Properties

$cache

$cache : array

Type

array — Array of cached inflections

$maxCacheSize

$maxCacheSize : integer

Type

integer — Max entries per cache

Methods

__construct()

__construct(\Guzzle\Inflection\InflectorInterface  $inflector, integer  $maxCacheSize = 500) 

Parameters

\Guzzle\Inflection\InflectorInterface $inflector

Inflector being decorated

integer $maxCacheSize

Maximum number of cached items to hold per cache

snake()

snake(string  $word) : string

Converts strings from camel case to snake case (e.g. CamelCase camel_case).

Parameters

string $word

Word to convert to snake case

Returns

string

camel()

camel(string  $word) : string

Converts strings from snake_case to upper CamelCase

Parameters

string $word

Value to convert into upper CamelCase

Returns

string

pruneCache()

pruneCache(string  $cache) 

Prune one of the named caches by removing 20% of the cache if it is full

Parameters

string $cache

Type of cache to prune