@@ -718,6 +718,41 @@ public function addAllowedTypes($option, $allowedTypes)
718718return $ this ;
719719 }
720720
721+ /**
722+ * Adds allowed types for one or more options.
723+ *
724+ * If a nested option name is passed it will apply to all nested options.
725+ *
726+ * Any type for which a corresponding is_<type>() function exists is
727+ * acceptable. Additionally, fully-qualified class or interface names may
728+ * be passed.
729+ *
730+ * @param string|string[] $options One or more option names
731+ * @param string|string[] $allowedTypes One or more accepted types
732+ *
733+ * @return OptionsResolver This instance
734+ *
735+ * @throws UndefinedOptionsException If an option is undefined
736+ * @throws AccessException If called from a lazy option or normalizer
737+ */
738+ public function addAllowTypesForAll ($ options ,$ allowedTypes )
739+ {
740+ if ($ this ->locked ) {
741+ throw new AccessException ('Allowed types cannot be added from a lazy option or normalizer. ' );
742+ }
743+
744+ foreach ((array )$ optionsas $ option ) {
745+ // Not supported for nested options
746+ if ($ this ->isNested ($ option )) {
747+ $ this ->addAllowTypesForAll ($ this ->nested [$ option ]->getDefinedOptions (),$ allowedTypes );
748+ }
749+
750+ $ this ->addAllowedTypes ($ option ,$ allowedTypes );
751+ }
752+
753+ return $ this ;
754+ }
755+
721756/**
722757 * Removes the option with the given name.
723758 *