<commit_before><?php

namespace Common\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType as SymfonyCollectionType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CollectionType extends AbstractType
{
    public function buildView(FormView $view, FormInterface $form, array $options): void
    {
        $view->vars = array_replace(
            $view->vars,
            [
                'allow_add' => $options['allow_add'],
                'allow_delete' => $options['allow_delete'],
                'add_button_text' => $options['add_button_text'],
                'delete_button_text' => $options['delete_button_text'],
                'prototype_name' => $options['prototype_name'],
            ]
        );
        if ($form->getConfig()->hasAttribute('prototype')) {
            $view->vars['prototype'] = $form->getConfig()->getAttribute('prototype')->createView($view);
        }
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults(
            [
                'allow_add' => false,
                'allow_delete' => false,
                'prototype' => true,
                'prototype_name' => '__name__',
                'add_button_text' => 'lbl.Add',
                'delete_button_text' => 'lbl.Delete',
                'options' => [],
                'type' => TextType::class,
            ]
        );
        $resolver->setNormalizer(
            'options',
            function (Options $options, $value) {
                $value['block_name'] = 'entry';

                return $value;
            }
        );
    }

    public function getParent(): string
    {
        return SymfonyCollectionType::class;
    }

    public function getBlockPrefix(): string
    {
        return 'bootstrap_collection';<commit_msg>Replace the option options with entry_options for the CollectionType<commit_after><?php

namespace Common\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType as SymfonyCollectionType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CollectionType extends AbstractType
{
    public function buildView(FormView $view, FormInterface $form, array $options): void
    {
        $view->vars = array_replace(
            $view->vars,
            [
                'allow_add' => $options['allow_add'],
                'allow_delete' => $options['allow_delete'],
                'add_button_text' => $options['add_button_text'],
                'delete_button_text' => $options['delete_button_text'],
                'prototype_name' => $options['prototype_name'],
            ]
        );
        if ($form->getConfig()->hasAttribute('prototype')) {
            $view->vars['prototype'] = $form->getConfig()->getAttribute('prototype')->createView($view);
        }
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults(
            [
                'allow_add' => false,
                'allow_delete' => false,
                'prototype' => true,
                'prototype_name' => '__name__',
                'add_button_text' => 'lbl.Add',
                'delete_button_text' => 'lbl.Delete',
                'entry_options' => [],
                'type' => TextType::class,
            ]
        );
        $resolver->setNormalizer(
            'entry_options',
            function (Options $options, $value) {
                $value['block_name'] = 'entry';

                return $value;
            }
        );
    }

    public function getParent(): string
    {
        return SymfonyCollectionType::class;
    }

    public function getBlockPrefix(): string
    {
        return 'bootstrap_collection';
{'fraction_non_alphanumeric': 0.12562694053021256, 'fraction_numerical': 0.0, 'mean_word_length': 2.219062259800154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6594018', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1093, 'n_words': 191}