alexanevsky/data-resolver

Transforms and validates data of arrays and entities

1.0.1 2022-05-06 21:39 UTC

This package is auto-updated.

Last update: 2024-10-23 23:34:00 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...