ZF-11566: Error in "Standard Validation Classes: NotEmpty" documenation.
Description
Hello,
I was working with Zend_Validate_NotEmpty and was using the array notation to configure the class. I noticed the the documentation was incorrect on how to use the array method.
Currently, the the figure under the subheader "Changing behaviour for Zend_Validate_NotEmpty" says this:
// Returns false on 0 or '0'
$validator = new Zend_Validate_NotEmpty(array(
Zend_Validate_NotEmpty::INTEGER,
Zend_Validate_NotEmpty::ZERO
));
// Returns false on 0 or '0'
$validator = new Zend_Validate_NotEmpty(array(
'integer',
'zero',
));
It should be this:
// Returns false on 0 or '0'
$validator = new Zend_Validate_NotEmpty(array(
'type' => array(
Zend_Validate_NotEmpty::INTEGER,
Zend_Validate_NotEmpty::ZERO
)
));
// Returns false on 0 or '0'
$validator = new Zend_Validate_NotEmpty(array(
'type' => array(
'integer',
'zero'
)
));
Thanks.
Comments
Posted by John Kelly (postalservice14) on 2011-08-18T23:08:09.000+0000
Attached Patch
Posted by Thomas Weidner (thomas) on 2011-08-19T05:48:33.000+0000
Thank you for this patch, but as you can see this issue is already in progress which means it is already been worked on.
Posted by John Kelly (postalservice14) on 2011-08-19T15:00:27.000+0000
You bet, Sorry about that. I just noticed it has been "In Progress" since the 28th of July. Didn't look like anyone was working on it. So I thought I'd knock it out real quick.
Posted by Thomas Weidner (thomas) on 2011-08-26T19:23:00.000+0000
Fixed in ZF2 with GH-286