<commit_before><?php

namespace AppBundle\Form;

use Novosga\Entity\Cargo;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CargoType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $modulos = [];
        dump($options['modulos']);
        foreach ($options['modulos'] as $modulo) {
            if ($modulo instanceof \Novosga\Module\ModuleInterface) {
                $modulos[$modulo->getDisplayName()] = $modulo->getKeyName();
            }
        }
        
        $builder
            ->add('nome')
            ->add('descricao', TextareaType::class, [
                'attr' => [
                    'rows' => 4
                ]
            ])
            ->add('modulos', ChoiceType::class, [
                'multiple' => true,
                'expanded' => true,
                'choices' => $modulos
            ])
        ;
    }
    
    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'data_class' => Cargo::class
            ])
            ->setRequired('modulos');
    }
}
<commit_msg>removed dump<commit_after><?php

namespace AppBundle\Form;

use Novosga\Entity\Cargo;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CargoType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $modulos = [];
        
        foreach ($options['modulos'] as $modulo) {
            if ($modulo instanceof \Novosga\Module\ModuleInterface) {
                $modulos[$modulo->getDisplayName()] = $modulo->getKeyName();
            }
        }
        
        $builder
            ->add('nome')
            ->add('descricao', TextareaType::class, [
                'attr' => [
                    'rows' => 4
                ]
            ])
            ->add('modulos', ChoiceType::class, [
                'multiple' => true,
                'expanded' => true,
                'choices' => $modulos
            ])
        ;
    }
    
    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'data_class' => Cargo::class
            ])
            ->setRequired('modulos');
    }
}

{'fraction_non_alphanumeric': 0.12731559447625462, 'fraction_numerical': 0.0006736274840013472, 'mean_word_length': 1.8393881453154877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '3846151', 'n_tokens_mistral': 833, 'n_tokens_neox': 817, 'n_words': 136}