Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (InflectorInterface $inflector, $maxCacheSize=500) | |
camel ($word) | |
snake ($word) | |
Protected Member Functions | |
pruneCache ($cache) | |
Protected Attributes | |
$cache | |
$decoratedInflector | |
$maxCacheSize | |
Decorator used to add memoization to previously inflected words
Definition at line 8 of file MemoizingInflector.php.
Guzzle\Inflection\MemoizingInflector::__construct | ( | InflectorInterface | $inflector, |
$maxCacheSize = 500 |
|||
) |
InflectorInterface | $inflector | Inflector being decorated |
int | $maxCacheSize | Maximum number of cached items to hold per cache |
Definition at line 35 of file MemoizingInflector.php.
References Guzzle\Inflection\MemoizingInflector\$maxCacheSize.
Guzzle\Inflection\MemoizingInflector::camel | ( | $word | ) |
Converts strings from snake_case to upper CamelCase
string | $word | Value to convert into upper CamelCase |
Implements Guzzle\Inflection\InflectorInterface.
Definition at line 58 of file MemoizingInflector.php.
References Guzzle\Inflection\MemoizingInflector\pruneCache().
|
protected |
Prune one of the named caches by removing 20% of the cache if it is full
string | $cache | Type of cache to prune |
Definition at line 73 of file MemoizingInflector.php.
References Guzzle\Inflection\MemoizingInflector\$cache.
Referenced by Guzzle\Inflection\MemoizingInflector\camel(), and Guzzle\Inflection\MemoizingInflector\snake().
Guzzle\Inflection\MemoizingInflector::snake | ( | $word | ) |
Converts strings from camel case to snake case (e.g. CamelCase camel_case).
string | $word | Word to convert to snake case |
Implements Guzzle\Inflection\InflectorInterface.
Definition at line 41 of file MemoizingInflector.php.
References Guzzle\Inflection\MemoizingInflector\pruneCache().
|
protected |
Array of cached inflections
Definition at line 14 of file MemoizingInflector.php.
Referenced by Guzzle\Inflection\MemoizingInflector\pruneCache().
|
protected |
Decorated inflector
Definition at line 29 of file MemoizingInflector.php.
|
protected |
Max entries per cache
Definition at line 23 of file MemoizingInflector.php.
Referenced by Guzzle\Inflection\MemoizingInflector\__construct().