zendframework / zend-inputfilter

InputFilter component from Zend Framework
BSD 3-Clause "New" or "Revised" License
64 stars 50 forks source link

Fix #114 - validate collection #118

Closed michalbundyra closed 8 years ago

michalbundyra commented 8 years ago

So far only test implemented as reported in #114. I had a look on it and it seems to be a quite complex...

Edited: errorMessage is now cleared (to null) before validation the Input only when it is an array. Why? The setter method setErrorMessage accept any type, but there is casting to (string). Method prepareRequiredValidationFailureMessage called in isValid sets errorMessage to an array, and in this case we have to clear it before each validation.

Probably it needs more refactor in future. Because current complexity of these validation there is terrible!