OptionsResolver
setAllowedValues(string $option, mixed $allowedValues)
Sets allowed values for an option. 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 $allowedValues One or more acceptable values/closures Return Value Option