Class Guzzle\Inflection\MemoizingInflector

InheritanceGuzzle\Inflection\MemoizingInflector
ImplementsGuzzle\Inflection\InflectorInterface

Decorator used to add memoization to previously inflected words

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
pruneCache() Prune one of the named caches by removing 20% of the cache if it is full Guzzle\Inflection\MemoizingInflector

Property Details

$cache protected property

Array of cached inflections

protected array $cache = ['snake' => [], 'camel' => []]
$decoratedInflector protected property

Decorated inflector

$maxCacheSize protected property

Max entries per cache

protected int $maxCacheSize null

Method Details

__construct() public method

public void __construct ( Guzzle\Inflection\InflectorInterface $inflector, $maxCacheSize 500 )
$inflector Guzzle\Inflection\InflectorInterface

Inflector being decorated

$maxCacheSize int

Maximum number of cached items to hold per cache

camel() public method

Converts strings from snake_case to upper CamelCase

public string camel ( $word )
$word string

Value to convert into upper CamelCase

pruneCache() protected method

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

protected void pruneCache ( $cache )
$cache string

Type of cache to prune

snake() public method

public void snake ( $word )
$word