<commit_before><?php

namespace AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints as Constraints;

class SetPasswordType extends AbstractType
{
    protected $options;

    public function __construct($options)
    {
        $this->options = $options;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
                ->add('password', 'repeated', [
                    'type' => 'password',
                    'invalid_message' => $this->options['passwordMismatchMessage'],
                ])
                ->add('showTermsAndConditions', 'checkbox', [
                    'mapped'=>false,
                    'constraints' => [new Constraints\NotBlank(['message' => 'user.agreeTermsUse.notBlank', 'groups'=>['user_set_password']])]
                ])
                ->add('save', 'submit');
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults([
              'translation_domain' => 'user-activate',
               'validation_groups' => ['user_set_password'],
        ]);
    }

    public function getName()
    {
        return 'set_password';
    }
}
<commit_msg>DDPB-907 add missing form usage of option<commit_after><?php

namespace AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints as Constraints;

class SetPasswordType extends AbstractType
{
    protected $options;

    public function __construct($options)
    {
        $this->options = $options;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('password', 'repeated', [
                'type' => 'password',
                'invalid_message' => $this->options['passwordMismatchMessage'],
            ]);

        if (!empty($this->options['showTermsAndConditions'])) {
            $builder->add('showTermsAndConditions', 'checkbox', [
                'mapped'=>false,
                'constraints' => [new Constraints\NotBlank(['message' => 'user.agreeTermsUse.notBlank', 'groups'=>['user_set_password']])]
            ]);
        }
        $builder->add('save', 'submit');
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults([
              'translation_domain' => 'user-activate',
               'validation_groups' => ['user_set_password'],
        ]);
    }

    public function getName()
    {
        return 'set_password';
    }
}

{'fraction_non_alphanumeric': 0.1273635390652872, 'fraction_numerical': 0.0010702818408847663, 'mean_word_length': 2.6041131105398456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, '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': '3001503', 'n_tokens_mistral': 757, 'n_tokens_neox': 733, 'n_words': 130}