src/Form/Type/Configurator/EntityTypeConfigurator.php
public function configure($name, array $options, array $metadata, FormConfigInterface $parentConfig)
    {
        if (!isset($options['multiple']) && $metadata['associationType'] & ClassMetadata::TO_MANY) {
            $options['multiple'] = true;
        }

        // Supported associations are displayed using advanced JavaScript widgets
        $options['attr']['data-widget'] = 'select2';

        // Configure "placeholder" option for entity fields
        if (($metadata['associationType'] & ClassMetadata::TO_ONE)
            && !isset($options['placeholder'])
            && isset($options['required']) && false === $options['required']
        ) {
            $options['placeholder'] = 'label.form.empty_value';
        }

        return $options;
    }
public function configure($name, array $options, array $metadata, FormConfigInterface $parentConfig)
    {
        if (!isset($options['multiple']) && $metadata['associationType'] & ClassMetadata::TO_MANY) {
            $options['multiple'] = true;
        }

        // Supported associations are displayed using advanced JavaScript widgets
        $options['attr']['data-widget'] = 'select2';

        // Configure "placeholder" option for entity fields
        if (($metadata['associationType'] & ClassMetadata::TO_ONE)
            && !isset($options['placeholder'])
            && isset($options['required']) && false === $options['required']
        ) {
            $options['placeholder'] = 'label.form.empty_value';
        }

        return $options;
    }
{@inheritdoc}