public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
    {
        if ($this->locked) {
            throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
        }

        if (!isset($this->defined[$option])) {
            throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
        }

        if (!\is_string($deprecationMessage) && !$deprecationMessage instanceof \Closure) {
            throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', \gettype($deprecationMessage)));
        }

        // ignore if empty string
        if ('' === $deprecationMessage) {
            return $this;
        }

        $this->deprecated[$option] = $deprecationMessage;

        // Make sure the option is processed
        unset($this->resolved[$option]);

        return $this;
    }
public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
    {
        if ($this->locked) {
            throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
        }

        if (!isset($this->defined[$option])) {
            throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
        }

        if (!\is_string($deprecationMessage) && !$deprecationMessage instanceof \Closure) {
            throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', \gettype($deprecationMessage)));
        }

        // ignore if empty string
        if ('' === $deprecationMessage) {
            return $this;
        }

        $this->deprecated[$option] = $deprecationMessage;

        // Make sure the option is processed
        unset($this->resolved[$option]);

        return $this;
    }
public function setDeprecated ( string $ option , $ deprecationMessage = 'The option "%name%" is deprecated.' ) : self { if ( $ this -> locked ) { throw new AccessException ( 'Options cannot be deprecated from a lazy option or normalizer.' ) ; } if ( ! isset ( $ this -> defined [ $ option ] ) ) { throw new UndefinedOptionsException ( sprintf ( 'The option "%s" does not exist, defined options are: "%s".' , $ option , implode ( '", "' , array_keys ( $ this -> defined ) ) ) ) ; } if ( ! \ is_string ( $ deprecationMessage ) && ! $ deprecationMessage instanceof \ Closure ) { throw new InvalidArgumentException ( sprintf ( 'Invalid type for deprecation message argument, expected string or \Closure, but got "%s".' , \ gettype ( $ deprecationMessage ) ) ) ; } // ignore if empty string if ( '' === $ deprecationMessage ) { return $ this ; } $ this -> deprecated [ $ option ] = $ deprecationMessage ; // Make sure the option is processed unset ( $ this -> resolved [ $ option ] ) ; return $ this ; }
Deprecates an option, allowed types or values.

Instead of passing the message, you may also pass a closure with the
following signature:

function (Options $options, $value): string {
// ...
}

The closure receives the value as argument and should return a string.
Return an empty string to ignore the option deprecation.

The closure is invoked when {@link resolve()} is called. The parameter
passed to the closure is the value of the option after validating it
and before normalizing it.

@param string|\Closure $deprecationMessage
Deprecates an option allowed types or values .