Hi there, it's me again!
I found a weird case to handle : I wanted to use a Juicer on a field and when I wrote tests I tried with a null value and found that it throws a php exception about the clean process.
$validator
->addField('foo', true)
->addJuicer('foo', (new \Chanmix51\ParameterJuicer\ParameterJuicer)
->addField('bar', true)
->addValidator('bar', function($v) {
if ("baz" !== $v) {
throw new \Chanmix51\ParameterJuicer\ValidationException('error.');
}
})
)
;
$data = [
'foo' => null,
];
$data = $validator->squash($data);
// PHP Fatal error: Uncaught TypeError: Argument 1 passed to Chanmix51\ParameterJuicer\ParameterJuicer::clean() must be of the type array, null given in /vendor/chanmix51/parameter-juicer/sources/lib/ParameterJuicer.php:348
I think that this case should be handle, what do you think?
Hi there, it's me again!
I found a weird case to handle : I wanted to use a Juicer on a field and when I wrote tests I tried with a null value and found that it throws a php exception about the clean process.
I think that this case should be handle, what do you think?