SerializablePolicy
in
Opt-in interface for policies that can be fully described as a plain array and reconstructed from it.
Implemented independently of PolicyInterface so that any policy class can opt in without forcing all policy implementations to be serializable.
Table of Contents
Methods
- fromDefinition() : static
- Reconstruct a policy instance from a previously serialized definition.
- toDefinition() : array<string, mixed>
- Return a JSON-serializable description of this policy.
Methods
fromDefinition()
Reconstruct a policy instance from a previously serialized definition.
public
static fromDefinition(array<string, mixed> $data) : static
Parameters
- $data : array<string, mixed>
Return values
statictoDefinition()
Return a JSON-serializable description of this policy.
public
toDefinition() : array<string, mixed>
Must include a 'type' key whose value uniquely identifies the class.