ovvio / serializer
Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
v1.0.3
2026-06-07 17:17 UTC
Requires
- php: >=8.5
- ovvio/exceptions: ^1.0
- symfony/property-access: ^8.1
- symfony/serializer: ^8.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
Technical Requirements & Installation
PHP 8.5 - Installation and Configuration
Composer (System Requirements)
To install run this:
composer require ovvio/serializer
Examples
<?php ... use Ovvio\Component\Serializer\SerializerFactory; ... /** * Example 1: JSON to array */ /** @var \Ovvio\Component\Serializer\SerializerInterface $serializer */ $serializer = SerializerFactory::create(); /** @var string $json */ $json = <<<JSON { "foo": "Foo", "bar": "Bar" } JSON; /** @var null|array $array */ $array = $serializer->jsonToArray(json: $json); /** * Example 2: array to JSON */ /** @var array $array */ $array = [ 'foo' => 'Foo', 'bar' => 'Bar', ]; /** @var string $json */ $json = $serializer->arrayToJson(array: $array);