zendframework / zend-inputfilter

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

Provide NotEmpty::IS_EMPTY validation message for required input #61

Closed weierophinney closed 9 years ago

weierophinney commented 9 years ago

Per #28, since 2.4, we've not been returning error messages in the expected format when a value is required but no value (or an empty value) was provided for the input.

This patch builds on #60, and update the test expectations to those reported in #28.

Maks3w commented 9 years ago

Following the reasoning of to restore the NonEmpty behavior the correct thing could be inject NonEmpty validator instead setErrorMessage

weierophinney commented 9 years ago

Following the reasoning of to restore the NonEmpty behavior the correct thing could be inject NonEmpty validator instead setErrorMessage

I consider this a stop-gap, as we'll be removing it (as we've deprecated this use case with earlier patches). As such, we're just trying to mimic previous behavior at this point.

Maks3w commented 9 years ago

This part is not deprecated (still smelling of new) so this could be reused in future developments.

The API suggested should be reused on v3.

I found this way does not allow customization through input specifications.