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

Segregated interfaces for Translator dependency of Validator component #4391

Conversation

weierophinney
Copy link
Member

This PR introduces segregated interfaces for the Translator dependency inside the Validator component.

This allows us to remove the hard dependency on the i18n component, and allows usage of the Validator with other translator systems via interface implementation.

A bridge is provided in the Zend\Mvc\I18n subcomponent; additionally, the MVC uses a translator factory that consumes that bridge to ensure the translator service works with all components.

- Allows validator component to use I18n as an optional dependency, by defining
  TranslatorInterface and TranslatorAwareInterface internally.
- MVC component contains a bridge class that extends i18n Translator,
  implementing the validator TranslatorInterface
- that creates and returns the bridged interface
- To ensure the bridge version is used, if ever retrieved.
- per php-cs-fixer
@akrabat
Copy link
Contributor

akrabat commented May 2, 2013

Every other factory within Zend\Mvc seems to live in Zend\Mvc\Service. Should TranslatorServiceFactory be in there too?

- from Zend\Mvc\I18n to Zend\Mvc\Service (per @akrabat)
@weierophinney
Copy link
Member Author

@akrabat Good point. Done!

@akrabat akrabat closed this in edb98a6 May 3, 2013
akrabat added a commit that referenced this pull request May 3, 2013
gianarb pushed a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
gianarb pushed 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.

2 participants