zendframework/zf2 — pull request #1467 by mwillbanks (2012-06-08 15:45:18+00:00)
Title: ZF2-340: Changed InputFilter Factory to imply required or allow_empty

Changes:

On the factory, if required or allow_empty is set, it will automatically set the other flag. If both are set, it will listen to their respective values.

Why:

Overall, this makes the InputFilter more intuitive for the end user; rather than having to specify both columns which generally doesn't make complete sense for the user. Generally speaking if they want to allow empty, they do not want it required and visa-versa. If the other behavior is required, they can explicitly set it from the factory.

Tests:

Altered existing tests to check for the behavior and added a new test.

Results:

phpunit Zend/InputFilter/FactoryTest.php
OK (14 tests, 48 assertions)

phpunit Zend/InputFilter/
OK (56 tests, 136 assertions)