flexic/recaster

Package to recast php objects.

1.0.2 2022-10-16 19:53 UTC

This package is auto-updated.

Last update: 2024-10-17 00:20:53 UTC


README

This package allows to recast php objects to object of other class.

Installation

Run

composer require flexic/recaster

to install flexic/recaster.

Cast to object of other class

$recaster = new Flexic\Recaster\Recaster($inputObject);
$object = $recaster->toClass(TargetClass::class);

Cast to array

$recaster = new Flexic\Recaster\Recaster($inputObject);
$arrayOfObject = $recaster->toArray();

License

This package is licensed using the GNU License.

Please have a look at LICENSE.md.

Donate