pew-pew / hydrator
Object hydrator kernel library
0.1.0
2024-03-17 11:39 UTC
Requires
- php: ^8.3
- psr/log: ^1.0|^2.0|^3.0
- symfony/stopwatch: ^5.4|^6.0|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.49
- phpunit/phpunit: ^10.5
- symfony/var-dumper: ^5.4|^6.0|^7.0
- vimeo/psalm: ^5.21
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-23 16:36:18 UTC
README
Hydrator
A set of interfaces for mapping arbitrary values to their typed equivalents and their inverses.
Installation
PewPew Hydrator is available as Composer repository and can be installed using the following command in a root of your project:
$ composer require pew-pew/hydrator
More detailed installation instructions are here.
Usage
$hydrator = new class implements \PewPew\Hydrator\HydratorInterface { public function hydrate(string $type, mixed $data): mixed { return ...; } }; $hydrator = new \PewPew\Hydrator\TraceableHydrator( hydrator: $hydrator, stopwatch: new \Symfony\Component\Stopwatch\Stopwatch(), ); $hydrator = new \PewPew\Hydrator\LoggableHydrator( hydrator: $hydrator, logger: new ExampleLogger(), );