baraja-core/serializer

There is no license information available for the latest version (v1.0.1) of this package.

Simple serializer any PHP type or structure to simple scalar array.

v1.0.1 2022-09-28 21:18 UTC

This package is auto-updated.

Last update: 2024-02-29 00:06:54 UTC


README

A simple serializer that creates a simple scalar array based on any PHP object or other data structure.

The serializer automatically handles backward and forward compatibility. Automatically handles security.

The output is ready to be sent via REST API.

How to use

class DTO {
	public function __construct(
		public string $name,
	) {
	}
}

$serializer = \Baraja\Serializer\Serializer::get();
var_dump($serializer->serialize(
	new DTO(name: 'Jan'),
));