Segregated interfaces for Translator dependency of Validator component #4391

Closed
wants to merge 7 commits into
from

Projects

None yet

2 participants

@weierophinney
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.

weierophinney added some commits May 2, 2013
@weierophinney weierophinney Segregated Translator/TranslatorAware interfaces for Validator
- 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
4bf9a34
@weierophinney weierophinney Create alternate Translator factory
- that creates and returns the bridged interface
bd8376a
@weierophinney weierophinney Add bridge Translator service factory to service config
- To ensure the bridge version is used, if ever retrieved.
00b81b5
@weierophinney weierophinney CS fixes
- per php-cs-fixer
69ce936
@weierophinney weierophinney Better descriptions for I18n and ServiceManager deps fe8ef66
@akrabat
Member
akrabat commented May 2, 2013

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

weierophinney added some commits May 2, 2013
@weierophinney weierophinney Move TranslatorServiceFactory
- from Zend\Mvc\I18n to Zend\Mvc\Service (per @akrabat)
de5d4d2
@weierophinney weierophinney Update service configuration for translator
- due to previous commit
1dc5ba5
@weierophinney
Member

@akrabat Good point. Done!

@akrabat akrabat added a commit that closed this pull request May 3, 2013
@akrabat akrabat Merge branch 'pr4391'
Close #4391
edb98a6
@akrabat akrabat closed this in edb98a6 May 3, 2013
@akrabat akrabat added a commit that referenced this pull request May 3, 2013
@akrabat akrabat Merge branch 'pr4391' into develop
Forward port #4391
ad05796
@gianarb gianarb pushed a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@akrabat akrabat Merge branch 'pr4391' 9628c66
@gianarb gianarb pushed a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@akrabat akrabat Merge branch 'pr4391' into develop 2fbc2a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment