leongrdic/seriale

2.0.1 2023-04-09 13:28 UTC

This package is auto-updated.

Last update: 2024-11-09 17:24:58 UTC


README

alternative to PHP serializing that recursively extracts public properties from objects and reconstructs or hydrates them using reflection

install

composer require leongrdic/seriale

usage

use Le\Seriale\Seriale;
$seriale = new Seriale;

$someObject = new SomeClass();
$someObject->publicProp = 'test';

$extracted = $seriale->extract($someObject);
// ..later..
$restored = $seriale->hydrate(SomeClass::class, $extracted);

$someObject->publicProp === $restored->publicProp // true