<commit_before><?php

namespace {{ namespace }}\Form\{{entity_class}};

{% block use_statements %}
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use AppBundle\Entity\{{ entity_class }};
{% endblock use_statements %}

{% block class_definition %}
class {{ form_class }} extends AbstractType
{% endblock class_definition %}
{
{% block class_body %}
    {%- if fields|length > 0 %}
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder

{%- for key , field in fields -%}

{% if field.type == 'DateTimeType' %}
        ->add('{{ key }}', {{ field.type }}::class,[{% if field.nullable == false %} 'required' => true {% else %} 'required' => false {% endif %}, 'mapped' => true ,'widget' => 'single_text',  'format' => 'yyyy-MM-dd'])
{% else %}
        ->add('{{ key }}', {{ field.type }}::class,[{% if field.nullable == false %} 'required' => true {% else %} 'required' => false {% endif %}, 'mapped' => true])
{%  endif %}



{%- endfor %}
;

}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => {{ entity_class }}::class,
));
}

{% endif %}

{% endblock class_body %}
}<commit_msg>add short syntax array<commit_after><?php

namespace {{ namespace }}\Form\{{entity_class}};

{% block use_statements %}
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use AppBundle\Entity\{{ entity_class }};
{% endblock use_statements %}

{% block class_definition %}
class {{ form_class }} extends AbstractType
{% endblock class_definition %}
{
{% block class_body %}
    {%- if fields|length > 0 %}
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder

{%- for key , field in fields -%}

{% if field.type == 'DateTimeType' %}
        ->add('{{ key }}', {{ field.type }}::class,[{% if field.nullable == false %} 'required' => true {% else %} 'required' => false {% endif %}, 'mapped' => true ,'widget' => 'single_text',  'format' => 'yyyy-MM-dd'])
{% else %}
        ->add('{{ key }}', {{ field.type }}::class,[{% if field.nullable == false %} 'required' => true {% else %} 'required' => false {% endif %}, 'mapped' => true])
{%  endif %}



{%- endfor %}
;

}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => {{ entity_class }}::class,
]);
}

{% endif %}

{% endblock class_body %}
}
{'fraction_non_alphanumeric': 0.18523153942428036, 'fraction_numerical': 0.0006257822277847309, 'mean_word_length': 4.708928571428571, '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': '3085699', 'n_tokens_mistral': 1072, 'n_tokens_neox': 980, 'n_words': 211}