Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[Validator] Refactor Date #5458

Merged
merged 1 commit into from
Nov 11, 2013
Merged

[Validator] Refactor Date #5458

merged 1 commit into from
Nov 11, 2013

Conversation

texdc
Copy link
Contributor

@texdc texdc commented Nov 9, 2013

The Date validator converts string, array, and int values into DateTime instances, or tries to, as part of the validation process. But, DateStep also uses a conversion process for helper dates. So, the conversion process was synchronized with Date and refactored out into separate methods to allow extending classes to reuse the functionality and to reduce the complexity of the validation method.

return true;
$type = gettype($param);
if (!in_array($type, array('string', 'integer', 'array'))) {
if ($addErrors) $this->error(self::INVALID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weierophinney added a commit that referenced this pull request Nov 11, 2013
weierophinney added a commit that referenced this pull request Nov 11, 2013
- Added blocks where necessary
- Conditional structures
- constant docblocks
weierophinney added a commit that referenced this pull request Nov 11, 2013
@weierophinney weierophinney merged commit 8df9023 into zendframework:develop Nov 11, 2013
@ghost ghost assigned weierophinney Nov 11, 2013
@texdc texdc deleted the Refactor-Date-Validator branch November 12, 2013 01:04
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
…or-Date-Validator

[Validator] Refactor Date
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
- Added blocks where necessary
- Conditional structures
- constant docblocks
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants