<commit_before><?php
/**
 * @author <NAME> (<EMAIL>)
 */

namespace Olry\MentalNoteBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityManager;

use Olry\MentalNoteBundle\Entity\Entry;
use Olry\MentalNoteBundle\Entity\Category;

use Olry\MentalNoteBundle\Form\Transformer\EntryTagTransformer;

class EntryType extends AbstractType
{
    public function __construct(EntityManager $em)
    {
        $this->em = $em;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('category', 'choice',
                array(
                    'expanded'       => true,
                    'choices'        => Category::getChoiceArray(),
                    'error_bubbling' => true
                ))
            ->add('url', 'text', array('label' => 'url', 'attr' => array('class' => 'input-large', 'focus' => 'focus')))
            ->add('title', 'text', array('label' => 'title', 'attr' => array('class' => 'input-large')))
            ->add(
                $builder
                    ->create('tags', 'text', array('label' => 'Tags', 'attr' => array('class' => 'input-large')))
                    ->addModelTransformer(new EntryTagTransformer($this->em->getRepository('Olry\MentalNoteBundle\Entity\Tag')))
                )
        ;
    }

    public function getName()
    {
        return 'entry';
    }
}<commit_msg>tags are no longer mandatory<commit_after><?php
/**
 * @author <NAME> (<EMAIL>)
 */

namespace Olry\MentalNoteBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityManager;

use Olry\MentalNoteBundle\Entity\Entry;
use Olry\MentalNoteBundle\Entity\Category;

use Olry\MentalNoteBundle\Form\Transformer\EntryTagTransformer;

class EntryType extends AbstractType
{
    public function __construct(EntityManager $em)
    {
        $this->em = $em;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add(
                'category',
                'choice',
                array(
                    'expanded'       => true,
                    'choices'        => Category::getChoiceArray(),
                    'error_bubbling' => true
                )
            )
            ->add('url', 'text', array('label' => 'url', 'attr' => array('class' => 'input-large', 'focus' => 'focus')))
            ->add('title', 'text', array('label' => 'title', 'attr' => array('class' => 'input-large')))
            ->add(
                $builder
                    ->create('tags', 'text', array('required' => false, 'label' => 'Tags', 'attr' => array('class' => 'input-large')))
                    ->addModelTransformer(new EntryTagTransformer($this->em->getRepository('Olry\MentalNoteBundle\Entity\Tag')))
            )
        ;
    }

    public function getName()
    {
        return 'entry';
    }
}
{'fraction_non_alphanumeric': 0.15473823724320743, 'fraction_numerical': 0.0, 'mean_word_length': 2.2254273504273505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 52, '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': '5556922', 'n_tokens_mistral': 882, 'n_tokens_neox': 855, 'n_words': 159}