diff --git a/components/options_resolver.rst b/components/options_resolver.rst index c731ae7dc45..87829813b17 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -660,13 +660,19 @@ This closure is useful to only deprecate some of the allowed types or values of the option:: $resolver + ->setDefault('encryption', null) ->setDefault('port', null) ->setAllowedTypes('port', array('null', 'int')) - ->setDeprecated('port', function ($value) { + ->setDeprecated('port', function (Options $options, $value) { if (null === $value) { return 'Passing "null" to option "port" is deprecated, pass an integer instead.'; } + // deprecation may also depend on another option + if ('ssl' === $options['encryption'] && 456 !== $value) { + return 'Passing a different port than "456" when the "encryption" option is set to "ssl" is deprecated.'; + } + return ''; }) ; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy