Closed autowp closed 7 years ago
@autowp That's expected behavior. Collections require that the incoming data is an array or traversable. If you're seeing that, it means the client-side code is submitting something that the input filter cannot deal with. As such, you have two options:
setData()
call in a try/catch block so you can report it yourself.Ok. But that looks not symmetrical to scalar validations like StringLength where wrong type never follow to Exception (->isValid([])
)
Validation is a separate subsystem, and independent from the input filters. Additionally, in this case, the exception happens before any validation is even attempted; it's thrown precisely because the value for would likely lead to serious errors further down the stack, including hydrators, filters, and validators.
That breaks to use input-filter especially where used nested collection filters.