Serializor\Codec class

Documentation

Serializor provides a powerful way to serialize PHP values including closures, anonymous classes, and other typically non-serializable types.

Properties (8)

private string $secret

The secret key used to sign serialized values.

private array $referenceSources

Tracks the original value of a reference, for comparison.

private array $referenceTargets

Tracks the new value of a reference for reuse.

private array $referenceCallbacks

Callbacks for when a reference is resolved.

private array $shortcuts

Shortcuts to Stasis objects for efficient serialization.

private WeakMap $encodedObjects
private array $stronglyReferenced

Tracks strongly referenced objects.

private bool $inWeakContext

Flag for weak context (WeakReference or WeakMap key).

Methods (10)

Documentation missing

Perform serialization of a value.

Mark WeakReference/WeakMap Stasis objects as dead if not strongly referenced.

Transform a value into a serializable structure.

Transform child values within a Stasis object.

Perform unserialization of a string.

Unserialize with compatibility detection for Laravel and Opis formats.

Unwrap closures serialized by Laravel or Opis into native Closure objects.

Documentation missing

Resolve child values within a Stasis object.

Source

src/Codec.php:22-614