zendframework / zend-validator

Validator component from Zend Framework
BSD 3-Clause "New" or "Revised" License
181 stars 136 forks source link

Added `ValidatorPluginManagerAwareInterface` to `ValidatorChain` #189

Closed boesing closed 7 years ago

boesing commented 7 years ago

This marks ValidatorChain::setPluginManager and ValidatorChain::getPluginManager as deprecated while proxying to ValidatorPluginManagerAwareInterface methods

weierophinney commented 7 years ago

What benefit does this provide?

Starting with the v3 components, we're moving away from the usage of *AwareInterface, as these require usage of initializers, which we have deprecated. I see this as a step backwards, particularly as the setPluginManager() method has been defined since initial release.

boesing commented 7 years ago

@weierophinney thanks for that explanation. So, since *AwareInterface (initializer) logic is being dropped, will there be an easy method to configure setter injection?

Just wondering, since writing a delegator for any use-case would lead to pretty much code, just in favor of avoiding aware interfaces.

Is there any "preview" or discussion I can follow to keep up to date with things which will change in upcoming versions?

weierophinney commented 7 years ago

Just wondering, since writing a delegator for any use-case would lead to pretty much code, just in favor of avoiding aware interfaces.

Writing a delegator is no more code than an initializer. It's a bit more configuration, but the delegator factory itself can be re-used across multiple services.

In terms of discussion, the zend-servicemanager changes were completed around 18 months ago, and we've had two additional minor releases of that library since. For ongoing discussion, we have: