Serializor\AnonymousClassStasis final class

Documentation

Stasis for anonymous class instances.

Extracts and stores the class definition source code.

Inheritance

Extends: Serializor\Stasis

Constants (8)

NameValue
STARTING 0
CONSTRUCTOR_ARGS 1
BEFORE_BODY 2
BODY 4
CLASS_MEMBER_NAME 5
CLASS_MEMBER_BODY 6
CLASS_CONSTRUCTOR_ARGS 7
DONE 255

Properties (10)

private string $hash
private string $code
private ?string $extends
private array $implements
private array $props
private static array $tokenCache
private static array $functionCache
private static array $classMakerCache
protected static ?WeakMap $results

WeakMap for caching resolved instances to preserve object identity.

public array $whenResolvedListeners

Methods (21)

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Documentation missing

Get the properties for transformation.

Documentation missing

Documentation missing

Check if found extends matches expected (handles short vs fully qualified names).

Check if found implements matches expected interfaces.

Documentation missing

public static from()
inherited from Serializor\Stasis

Create the appropriate Stasis subclass for the given value.

public static registerFactory()
inherited from Serializor\Stasis

Register a custom factory for handling user-defined types.

public isSimple()
inherited from Serializor\Stasis

Check if this Stasis can be serialized without Box wrapper.

public whenResolved()
inherited from Serializor\Stasis

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

public setInstance()
inherited from Serializor\Stasis

Store the resolved instance and notify listeners.

public hasInstance()
inherited from Serializor\Stasis

Check if this Stasis has already been resolved.

protected getCachedInstance()
inherited from Serializor\Stasis

Get the cached instance if it exists.

protected static init()
inherited from Serializor\Stasis

Documentation missing

public static getObjectProperties()
inherited from Serializor\Stasis

Get object properties including private/protected from parent classes.

public static setObjectProperties()
inherited from Serializor\Stasis

Set object properties including private/protected from parent classes.

Source

src/AnonymousClassStasis.php:15-414