Serialization

Helper class for interacting with SerializableClosures

 class Winter\Storm\Support\Serialization

Methods

public static unwrapClosure (SerializableClosure | mixed $callable) : Closure | mixed

If the provided argument is an instance of SerializableClosure it gets unwrapped and the original closure returned, which is the recommended behaviour. Otherwise the provided value is returned unmodified

Parameters
Property Description
$callable
SerializableClosure | mixed
Returns
Closure | mixed

public static wrapClosure (Closure | mixed $callable) : SerializableClosure | mixed

Wraps a closure in a SerializableClosure, returns the provided object if it's not a closure.

Parameters
Property Description
$callable
Closure | mixed

provided callable to be wrapped if it's a closure

Returns
SerializableClosure | mixed
Copyright © 2024 Winter CMS