StoredObjects final class
Minn\Runtime\StoredObjects · public/minn/src/Minn/Runtime/StoredObjects.php · 64 lines
The classes a stored blob may name and come back as. The serialized reader never instantiates; the facade registers one factory per value class it owns (WP_Post, WP_Term, WP_Comment) and a record naming any other class stays a stdClass of its properties. That is what lets a transient the reference wrote, holding post objects, read back typed.
Constants and properties
| private | WRAPPERS = array ( 'arrayobject' => 'ArrayObject', 'arrayiterator' => 'ArrayIterator', 'recursivearrayiterator' => 'RecursiveArrayIterator', ) | PHP's array wrappers a stored record may name, by lower-cased class name. |
| private | static array $factories |
Public
| static | register(string $class, Closure $factory): void# | Registers what a record naming this class becomes. |
| static | reviver(): Closure# | The reviver the serialized reader takes: PHP's array wrappers rebuilt, a factory's object, or the properties as they are. |
| static | knows(string $class): bool# | Whether a factory is registered for the class. |
| static | reset(): void# | Forgets every factory, for suites. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | arrayWrapper(string $class, stdClass $properties): ?object# | PHP's own array wrappers, stored as their four numbered parts (flags, storage, member properties, iterator class), rebuilt through their constructors so nothing else runs. Plugins keep settings in them (CleanTalk does), and the reference reads them back as the real class; written back, they serialize to the same bytes. One wrapping an object, or carrying member properties, stays a record of its parts.
|
Nothing matches.