/**
* Initializes the types.
*
* @throws UnexpectedTypeException if any registered type is not an instance of FormTypeInterface
*/
private function initTypes(): void
{ $this->types =
[];
foreach ($this->
loadTypes() as $type) { if (!
$type instanceof FormTypeInterface
) { throw new UnexpectedTypeException($type, FormTypeInterface::
class);
} $this->types
[$type::
class] =
$type;
} } /**
* Initializes the type extensions.
*
* @throws UnexpectedTypeException if any registered type extension is not
* an instance of FormTypeExtensionInterface
*/