baraja-core/serializer

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

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

v1.0.0 2022-07-25 08:23 UTC

This package is auto-updated.

Last update: 2022-09-07 11:36:05 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'),
));