Issues

ZF-11566: Error in "Standard Validation Classes: NotEmpty" documenation.

Issue Type: Docs: Problem Created: 2011-07-14T22:59:55.000+0000 Last Updated: 2011-08-26T19:23:00.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Ryan Cavicchioni (rcavicchioni) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments: - ZF-11566.patch

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:

<pre class="highlight">
// 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:

<pre class="highlight">
// 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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts