Symfony\Component\OptionsResolver\OptionsResolverInterface::setOptional
Sets optional options.
This method declares valid option names without setting default values for them. If these options are not passed to and no default has been set for them, they will be missing in the final options array. This can be helpful if you want to determine whether an option has been set or not because otherwise would trigger an exception for unknown options.
Signature
public function setOptional(array
$optionNames )
Parameters
$optionNames
— array- A list of option names.
Returns
- OptionsResolverInterface
- The resolver instance.
Errors/Exceptions
-
OptionDefinitionException
- When trying to pass default values.