RECURSION
RECURSION = "{{RECURSION}}" : string
The special value marking a recursive reference to a closure.
This is the serializer class used for serializing Closure objects.
We're abstracting away all the details, impossibilities, and scary things that happen within.
$analyzer : \SuperClosure\Analyzer\ClosureAnalyzer
The closure analyzer instance.
__construct(\SuperClosure\Analyzer\ClosureAnalyzer|null $analyzer = null, string|null $signingKey = null)
Create a new serializer instance.
| \SuperClosure\Analyzer\ClosureAnalyzer|null | $analyzer | Closure analyzer instance. |
| string|null | $signingKey | HMAC key to sign closure data. |
getData(\Closure $closure, boolean $forSerialization = false) : \Closure
Retrieves data about a closure including its code, context, and binding.
The data returned is dependant on the ClosureAnalyzer implementation
used and whether the $forSerialization parameter is set to true. If
$forSerialization is true, then only data relevant to serializing the
closure is returned.
| \Closure | $closure | Closure to analyze. |
| boolean | $forSerialization | Include only serialization data. |
wrapClosures(mixed $data, \SuperClosure\SerializerInterface $serializer)
Recursively traverses and wraps all Closure objects within the value.
NOTE: THIS MAY NOT WORK IN ALL USE CASES, SO USE AT YOUR OWN RISK.
| mixed | $data | Any variable that contains closures. |
| \SuperClosure\SerializerInterface | $serializer | The serializer to use. |
verifySignature(string $signature, string $data)
Verifies the signature for a closure's serialized data.
| string | $signature | The provided signature of the data. |
| string | $data | The data for which to verify the signature. |
if the signature is invalid.