\LazyJsonMapper\PropertyPropertyMapCache

Storage container for compiled class property maps.

Summary

Methods
Properties
Constants
clearCache()
$classMaps
$compilerLocks
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$classMaps

$classMaps : array

Compiled property map definition cache.

Class maps are built at runtime the first time we encounter each class. This cache is necessary so that we instantly have fully-validated maps without needing to constantly re-build/validate the property definitions.

Type

array

$compilerLocks

$compilerLocks : array

Classes that are locked during their map compilation.

This is used internally for detecting circular references in "import class" instructions during property map compilation. For example, if A extends LazyJsonMapper, imports B and B extends LazyJsonMapper, imports A, then the compilation of either class will fail gracefully instead of attempting to recursively allocate infinite memory and dying.

For example, compiling A would mark A as an "unresolved (locked) class", and then we'd encounter its instruction to import B, and then we'll attempt to resolve B. Then, B encounters its instruction to import A and sees that it's a locked class and understands that A is currently being compiled which means that we've detected a circular import reference. At that point, we'll throw an exception.

Type

array

Methods

clearCache()

clearCache() 

Clear the contents of the cache.

Be aware that clearing the cache will only release OUR references to the compiled property maps. If there are any other variables linked to the contents of the cache, then those cache entries will NOT be freed by PHP until those additional variable references are garbage-collected.