You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: