mvaliolahi / hydrate
There is no license information available for the latest version (v1.0.5) of this package.
PHP Hydrator Package.
v1.0.5
2023-03-01 14:15 UTC
Requires
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-02-27 22:36:46 UTC
README
Install
composer require mvaliolahi/hydrate
Example
$hydrate = new Hydrate(); /** * @var PostDTO */ $post = $hydrate->to(PostDTO::class, [ 'title' => 'Test', 'description' => 'sample post' ]);
- Tip: third argument of to() method can be use to overwrite data.
todo
- cast some fields to specefic object after hydrate.
- add toArray method.