mvaliolahi / hydrate
PHP Hydrator Package.
Installs: 34 703
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- phpunit/phpunit: ^10.0
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.