OptionsResolver::isRequired()

bool isRequired(string $option) Returns whether an option is required. An option is required if it was passed to {@link setRequired()}. Parameters string $option The name of the option Return Value bool Whether the option is required

OptionsResolver::isMissing()

bool isMissing(string $option) Returns whether an option is missing a default value. An option is missing if it was passed to {@link setRequired()}, but not to {@link setDefault()}. This option must be passed explicitly to {@link resolve()}, otherwise an exception will be thrown. Parameters string $option The name of the option Return Value bool Whether the option is missing

OptionsResolver::isDefined()

bool isDefined(string $option) Returns whether an option is defined. Returns true for any option passed to {@link setDefault()}, {@link setRequired()} or {@link setDefined()}. Parameters string $option The option name Return Value bool Whether the option is defined

OptionsResolver::hasDefault()

bool hasDefault(string $option) Returns whether a default value is set for an option. Returns true if {@link setDefault()} was called for this option. An option is also considered set if it was set to null. Parameters string $option The option name Return Value bool Whether a default value is set

OptionsResolver::getRequiredOptions()

string[] getRequiredOptions() Returns the names of all required options. Return Value string[] The names of the required options See also isRequired()

OptionsResolver::getMissingOptions()

string[] getMissingOptions() Returns the names of all options missing a default value. Return Value string[] The names of the missing options See also isMissing()

OptionsResolver::getDefinedOptions()

string[] getDefinedOptions() Returns the names of all defined options. Return Value string[] The names of the defined options See also isDefined()

OptionsResolver::count()

int count() Returns the number of set options. This may be only a subset of the defined options. Return Value int Number of options Exceptions AccessException If accessing this method outside of {@link resolve()} See also \Countable::count()

OptionsResolver::clear()

OptionsResolver clear() Removes all options. Return Value OptionsResolver This instance Exceptions AccessException If called from a lazy option or normalizer

OptionsResolver::addAllowedValues()

OptionsResolver addAllowedValues(string $option, mixed $allowedValues) Adds allowed values for an option. The values are merged with the allowed values defined previously. Instead of passing values, you may also pass a closures with the following signature: function ($value) { // return true or false } The closure receives the value as argument and should return true to accept the value and false to reject the value. Parameters string $option The option name mixed $allowe