dev-master
9999999-devPHP PSR-7 compatible cacheable hydrator for modern application.
MIT
The Requires
The Development Requires
0.0.1
0.0.1.0PHP PSR-7 compatible cacheable hydrator for modern application.
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
PHP PSR-7 compatible cacheable hydrator for modern application.
PHP7 PSR-5 compatible cacheable hydrator for modern application., (*2)
composer install grzesie2k/hydrator
<?php
$hydrator = $hydratorFactory->createHydrator('int[]'); // any valid type
$intList = $hydrator->hydrator([1, 2, 3]); // ✓ OK
$intList = $hydrator->hydrator([1, 'a', 2]); // ☹ exception
<?php
class Example
{
/**
* @param int $id
* @param string $name we can read types from PHPDoc
*/
public function __construct(int $id, $name) // or from type hints
{
// ... some operation
}
}
$hydrator = $hydratorFactory->createHydrator(Example::class);
$hydrator->hydrate(\json_decode('{"id":2,"name":"Adam"}')); // ✓ OK
$hydrator->hydrate(\json_decode('{"id":"Nope","name":"Janek"}')); // ☹ exception
PHP PSR-7 compatible cacheable hydrator for modern application.
MIT
PHP PSR-7 compatible cacheable hydrator for modern application.
MIT