Download the PHP package stratadox/deserializer without Composer
On this page you can find all versions of the php package stratadox/deserializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package deserializer
Deserializer
Transforms serialized data into objects.
Installation
Install with composer require stratadox/deserializer
What is this?
An object that Deserializes
can convert serialized
data into objects.
The serialized
input data is expected to have the form of an array, either
numeric or associative.
This way, one can easily convert both the results of sql queries and decoded
json, as well as session data and other sources.
How to use this?
To write the contents of an associative array to an object, one can use:
For writing the contents of a numerically indexed array into a collection object, use:
Or
In cases where no deserialization is needed, but a Deserializer is expected,
one can use the ArrayDeserializer
:
What else can it do?
By default, the collection deserializer uses a CollectionHydrator
and the
object deserializer uses an ObjectHydrator
for simple objects, or a
ReflectiveHydrator
when inheritance is involved.
This default behaviour can be changed by injecting custom (potentially decorated) hydrators and instantiators:
In some cases, the input can vary in such a way that a different deserializer is required for different types of data.
For instance, when the input data represents an inheritance structure:
These features can be combined into more advanced deserialization structures, such as conditionally applied deserializers that are configured with mapped hydrators.
All versions of deserializer with dependencies
ext-json Version *
stratadox/deserializer-contracts Version ^0.3
stratadox/hydrator Version ^6.0.1
stratadox/instantiator Version ^0.2
stratadox/specification Version ^1.0
stratadox/immutable-collection Version ^2