daylerees / sanitizer

Sanitize data using a number of mutation methods.
259 stars 22 forks source link

add support for closures in rules #20

Closed melihovv closed 7 years ago

melihovv commented 7 years ago

For example,

$rules = [
    'name' => [
    'trim',
    function ($value) {
        return strtoupper($value);
    }
    ],
    'email' => 'trim|strtolower'
];