/**
* Creates an empty form configuration.
*
* @param string|null $name The form name
* @param string|null $dataClass The class of the form's data
*
* @throws InvalidArgumentException if the data class is not a valid class or if
* the name contains invalid characters
*/
public function __construct(?string
$name, ?string
$dataClass, EventDispatcherInterface
$dispatcher, array
$options =
[]) { self::
validateName($name);
if (null !==
$dataClass && !
class_exists($dataClass) && !
interface_exists($dataClass, false
)) { throw new InvalidArgumentException(sprintf('Class "%s" not found. Is the "data_class" form option set correctly?',
$dataClass));
} $this->name =
(string) $name;
$this->dataClass =
$dataClass;
$this->dispatcher =
$dispatcher;
$this->options =
$options;
}