OptionsResolverInterface deprecated::resolve()

array resolve(array $options = array()) Returns the combination of the default and the passed options. Parameters array $options The custom option values. Return Value array A list of options and their values. Exceptions InvalidOptionsException If any of the passed options has not been defined or does not contain an allowed value. MissingOptionsException If a required option is missing. OptionDefinitionException If a cyclic dependency is detected between two lazy options.

OptionsResolverInterface deprecated::replaceDefaults()

OptionsResolverInterface replaceDefaults(array $defaultValues) Replaces default option values. Old defaults are erased, which means that closures passed here cannot access the previous default value. This may be useful to improve performance if the previous default value is calculated by an expensive closure. Parameters array $defaultValues A list of option names as keys and default values or closures as values. Return Value OptionsResolverInterface The resolver instance.

OptionsResolverInterface deprecated::isRequired()

bool isRequired(string $option) Returns whether an option is required. An option is required if it has been passed to {@link setRequired()}, but not to {@link setDefaults()}. That is, the option has been declared as required and no default value has been set. Parameters string $option The name of the option. Return Value bool Whether the option is required.

OptionsResolverInterface deprecated::isKnown()

bool isKnown(string $option) Returns whether an option is known. An option is known if it has been passed to either {@link setDefaults()}, {@link setRequired()} or {@link setOptional()} before. Parameters string $option The name of the option. Return Value bool Whether the option is known.

OptionsResolverInterface deprecated::addAllowedValues()

OptionsResolverInterface addAllowedValues(array $allowedValues) Adds allowed values for a list of options. The values are merged with the allowed values defined previously. Parameters array $allowedValues A list of option names as keys and arrays with values acceptable for that option as values. Return Value OptionsResolverInterface The resolver instance. Exceptions InvalidOptionsException If an option has not been defined (see {@link isKnown()}) for which an allowed value is

OptionsResolverInterface deprecated::addAllowedTypes()

OptionsResolverInterface addAllowedTypes(array $allowedTypes) Adds allowed types for a list of options. The types are merged with the allowed types defined previously. Parameters array $allowedTypes A list of option names as keys and type names passed as string or array as values. Return Value OptionsResolverInterface The resolver instance. Exceptions InvalidOptionsException If an option has not been defined for which an allowed type is set.

OptionsResolverInterface deprecated

interface OptionsResolverInterface deprecated since version 2.6, to be removed in 3.0. Use {@link OptionsResolver} instead. Methods OptionsResolverInterface setDefaults(array $defaultValues) Sets default option values. OptionsResolverInterface replaceDefaults(array $defaultValues) Replaces default option values. OptionsResolverInterface setOptional(array $optionNames) Sets optional options. OptionsResolverInterface setRequired(array $optionNames) Sets required options.

OptionsResolver::setRequired()

OptionsResolver setRequired(string|string[] $optionNames) Marks one or more options as required. Parameters string|string[] $optionNames One or more option names Return Value OptionsResolver This instance Exceptions AccessException If called from a lazy option or normalizer

OptionsResolver::setNormalizer()

OptionsResolver setNormalizer(string $option, Closure $normalizer) Sets the normalizer for an option. The normalizer should be a closure with the following signature: php function (Options $options, $value) { // ... } The closure is invoked when {@link resolve()} is called. The closure has access to the resolved values of other options through the passed {@link Options} instance. The second parameter passed to the closure is the value of the option. The resolved option value

OptionsResolver::setDefined()

OptionsResolver setDefined(string|string[] $optionNames) Defines a valid option name. Defines an option name without setting a default value. The option will be accepted when passed to {@link resolve()}. When not passed, the option will not be included in the resolved options. Parameters string|string[] $optionNames One or more option names Return Value OptionsResolver This instance Exceptions AccessException If called from a lazy option or normalizer