Serializor\Stasis abstract class

Documentation

Abstract base class for serializing values that can't be natively serialized.

Each subclass handles a specific type with typed properties for efficient serialization.

Properties (3)

protected static ?WeakMap $results

WeakMap for caching resolved instances to preserve object identity.

public array $whenResolvedListeners
private static array $customFactories

Custom factories for extending Stasis with user-defined types.

Methods (12)

Create the appropriate Stasis subclass for the given value.

Register a custom factory for handling user-defined types.

Restore the original value from this Stasis.

Get the class name this Stasis represents.

Check if this Stasis can be serialized without Box wrapper.

Add a callback to be invoked when this Stasis is resolved.

Store the resolved instance and notify listeners.

Check if this Stasis has already been resolved.

Get the cached instance if it exists.

Documentation missing

Get object properties including private/protected from parent classes.

Set object properties including private/protected from parent classes.

Source

src/Stasis.php:21-254