Zend\Validator\Alnum does not exist #935

Merged
merged 1 commit into from Jul 12, 2013

Conversation

Projects
None yet
4 participants
@joshribakoff
Contributor

joshribakoff commented Jul 3, 2013

Your documentation is wrong. This class doesn't exist, even looking back at the earliest tags in ZF2. Why did it go in to the docs wrong in the first place? Very frustrating as a user.

Zend\Validator\Alnum does not exist
Your documentation is wrong. This class doesn't exist, even looking back at the earliest tags in ZF2. Why did it go in to the docs wrong in the first place? Very frustrating as a user.
@weierophinney

This comment has been minimized.

Show comment Hide comment
@weierophinney

weierophinney Jul 3, 2013

Owner

Please remember that most functionality was migrated from ZF1, including the documentation. As name changes were made, we tried to update the documentation, but those changes did not always happen. While I realize this is frustrating, please don't vent frustrations in the issues/pull requests; keep the dialog friendly.

Owner

weierophinney commented Jul 3, 2013

Please remember that most functionality was migrated from ZF1, including the documentation. As name changes were made, we tried to update the documentation, but those changes did not always happen. While I realize this is frustrating, please don't vent frustrations in the issues/pull requests; keep the dialog friendly.

@joshribakoff

This comment has been minimized.

Show comment Hide comment
@joshribakoff

joshribakoff Jul 3, 2013

Contributor

Ok sorry not trying to be rude, but its a problem as we both agree. A solution could be to unit test the example code, and make sure all example code uses fully qualified namespaces so the tests can run, or have some monster 'use' statement in the setUp() method of the tests for the documentation? Its a huge undertaking, but this is a huge issue IMO.

Contributor

joshribakoff commented Jul 3, 2013

Ok sorry not trying to be rude, but its a problem as we both agree. A solution could be to unit test the example code, and make sure all example code uses fully qualified namespaces so the tests can run, or have some monster 'use' statement in the setUp() method of the tests for the documentation? Its a huge undertaking, but this is a huge issue IMO.

@froschdesign

This comment has been minimized.

Show comment Hide comment
@froschdesign

froschdesign Jul 5, 2013

Member

Should we move to the "Alnum" validator to the I18n Validators chapter? (With a notice on the "Standard Validation Classes" page.)

Member

froschdesign commented Jul 5, 2013

Should we move to the "Alnum" validator to the I18n Validators chapter? (With a notice on the "Standard Validation Classes" page.)

@froschdesign

This comment has been minimized.

Show comment Hide comment
@froschdesign

froschdesign Jul 5, 2013

Member

Same problem with the "Alpha" and "PostCode" validator.

Member

froschdesign commented Jul 5, 2013

Same problem with the "Alpha" and "PostCode" validator.

@joshribakoff

This comment has been minimized.

Show comment Hide comment
@joshribakoff

joshribakoff Jul 5, 2013

Contributor

I've proposed here zendframework/zf2#4778 that we actually split validation logic between Zend\Validator and Zend\I18n a bit differently. Instead of some validators being in one namespace, all validators should be in one namespace. Behind the scenes a validator could call upon other packages though.

I should be able to validate things with Zend\Validator. Alnum should validate simple English text out of the box. I18n package should just provide enhanced functionality.

As it is now I can't validate Alnum text with just Zend\Validator, but its composer.json only "suggests" I18n.

So something like this

  • If I18n is not present and I pass to Alnum a string with accented characters, it says its NOT valid
  • If I18n is present and I pass to Alnum a string with accented characters, it says it IS valid

Logically, the API exposed to the user for validating should all be in the Zend\Validate namespace. If it delegates to other components behind the scenes, that's an implementation concern. Forcing users to interact with multiple namespaces though would be a bad design I feel like.

Contributor

joshribakoff commented Jul 5, 2013

I've proposed here zendframework/zf2#4778 that we actually split validation logic between Zend\Validator and Zend\I18n a bit differently. Instead of some validators being in one namespace, all validators should be in one namespace. Behind the scenes a validator could call upon other packages though.

I should be able to validate things with Zend\Validator. Alnum should validate simple English text out of the box. I18n package should just provide enhanced functionality.

As it is now I can't validate Alnum text with just Zend\Validator, but its composer.json only "suggests" I18n.

So something like this

  • If I18n is not present and I pass to Alnum a string with accented characters, it says its NOT valid
  • If I18n is present and I pass to Alnum a string with accented characters, it says it IS valid

Logically, the API exposed to the user for validating should all be in the Zend\Validate namespace. If it delegates to other components behind the scenes, that's an implementation concern. Forcing users to interact with multiple namespaces though would be a bad design I feel like.

@froschdesign

This comment has been minimized.

Show comment Hide comment
@froschdesign

froschdesign Jul 5, 2013

Member

Related to #842

Member

froschdesign commented Jul 5, 2013

Related to #842

@Maks3w

This comment has been minimized.

Show comment Hide comment
@Maks3w

Maks3w Jul 12, 2013

Member

In the meantime I'll merge this for avoid confusions. Later we can move the validator to the correct namespace

Member

Maks3w commented Jul 12, 2013

In the meantime I'll merge this for avoid confusions. Later we can move the validator to the correct namespace

@ghost ghost assigned Maks3w Jul 12, 2013

Maks3w added a commit that referenced this pull request Jul 12, 2013

Maks3w added a commit that referenced this pull request Jul 12, 2013

Maks3w added a commit that referenced this pull request Jul 12, 2013

@Maks3w Maks3w merged commit 56ab59c into zendframework:master Jul 12, 2013

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