public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($this->areOptionsValid($options)) {
throw new InvalidConfigurationException('array or (\\Traversable and \\ArrayAccess) of "Sylius\\Component\\Variation\\Model\\OptionInterface" must be passed to collection');
}
foreach ($options['options'] as $i => $option) {
if (!$option instanceof ProductOptionInterface) {
throw new InvalidConfigurationException(sprintf('Each object passed as option list must implement "%s"', ProductOptionInterface::class));
}
$builder->add((string) $option->getCode(), ProductOptionValueChoiceType::class, ['label' => $option->getName() ?: $option->getCode(), 'option' => $option, 'property_path' => '[' . $i . ']']);
}
}