zend-i18n icon indicating copy to clipboard operation
zend-i18n copied to clipboard

Deprecate the PostCode::setService() and PostCode::getService() method

Open froschdesign opened this issue 6 years ago • 1 comments

Problem

The PostCode validator allows additional validations via an optional service callback. The callback runs before the standard validation of the PostCode class. Internally, the additional validation is done by zend-validator's Callback class.

But:

  • this functionality was never documented
  • the usage of a validator within another validator is confusing
  • this functionality is not available in other validators

Alternative

As an alternative to the additional validation, a validator chain should be used.

Deprecation

It should be deprecated in the next minor version (2.11.0) and removed with the next major version (3.0.0).

Code Reference

https://github.com/zendframework/zend-i18n/blob/c6c465ad5c7c9b93304f2a2832c9b4deafb3fcdf/src/Validator/PostCode.php#L307-L327

https://github.com/zendframework/zend-i18n/blob/c6c465ad5c7c9b93304f2a2832c9b4deafb3fcdf/src/Validator/PostCode.php#L368-L387

froschdesign avatar Feb 17 '19 09:02 froschdesign

This repository has been closed and moved to laminas/laminas-i18n; a new issue has been opened at https://github.com/laminas/laminas-i18n/issues/6.

weierophinney avatar Dec 31 '19 23:12 weierophinney