ZF-7631: Zend_Validate_NotEmpty compatibility


Zend_Validate_NotEmpty doesn't accept anything else then string, int, float, bool but it was. Now object, arrays, etc are returnd as "empty"


No they're not. You should look which sort of failure is returned.

In the above case you get "Invalid type given, value should be float, string, or integer".

I agree that Arrays are missing. But a object can never be empty. To check a object for emptyness is quite useless and in my eyes a failure. Same for ressources.

About objects:

What if i have such code:

{{$value = ($_POST['value']) ? new Zend_Date($_POST['value']) : null;}}

And im checking: {{Zend_Validate::is($value,'NotEmpty')}}

I know that i can make a different solution but - as above - i don't know what's the type of $value - i just wan't to check if it's "NotEmpty".

As You said the objects are never empty so it could bo something like: {{if(is_object($value)) return true;}}


Allowed arrays. Objects and Ressources are disallowed.

Please see ZF-9968