alexanevsky / data-resolver
Transforms and validates data of arrays and entities
1.0.1
2022-05-06 21:39 UTC
Requires
- php: >=7.4
- doctrine/orm: ^2.6
- symfony/string: ^5.1|^6.0
- symfony/translation: ^5.2|^6.0
- symfony/validator: ^5.1|^6.0
This package is auto-updated.
Last update: 2024-11-23 23:47:08 UTC
README
Simple example
Configure resolver:
use Alexanevsky\DataResolver\Resolver; $resolver = new Resolver(); $resolver->define('foo', 'string'); $resolver->define('bar', 'int');
Then try to resolve data:
$data = [ 'qwerty' => 'Hello World', 'bar' => '12345' ]; $result = $resolver->resolve($data); var_dump($result->toArray());
And get result:
{ "foo": "", "bar": 12345 }
Detailed documentation will be added later...