fix the constructor's type-autodetection accepts wrong parameters #4351

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

noopable commented Apr 29, 2013

$validator = new \Zend\Validator\NotEmpty(array('translatorEnabled' => true));
var_dump($validator->getType());
var_dump($validator->isValid(''));

expects
493
false

but actually
1
true.

because if 'type' is not found in $options, the autodetection compares bool(true) to string(constants), it is true. And autodetector set 'type' true.
So, in_array 's third parameter should be true.

@ghost ghost assigned weierophinney Apr 29, 2013

weierophinney added a commit that referenced this pull request Apr 29, 2013

Merge pull request #4351 from noopable/patch-validator-notempty
fix the constructor's type-autodetection accepts wrong parameters

weierophinney added a commit that referenced this pull request Apr 29, 2013

@noopable noopable deleted the noopable:patch-validator-notempty branch Dec 13, 2013

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

Merge pull request zendframework/zendframework#4351 from noopable/pat…
…ch-validator-notempty

fix the constructor's type-autodetection accepts wrong parameters

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment