<commit_before><?php

namespace Hackzilla\Bundle\TicketBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TicketMessageType extends AbstractType
{
    private $_securityContent;
    private $_newTicket;

    public function __construct(SecurityContextInterface $securityContext, $newTicket = false)
    {        
        $this->_securityContent = $securityContext;
        $this->_newTicket = $newTicket;
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
                ->add('message', 'textarea', array(
                    'required' => false,
                ))
                ->add('priority', new Type\PriorityType());

        // if existing ticket add status
        if (!$this->_newTicket) {
            if ($this->_securityContent->isGranted('ROLE_TICKET_ADMIN')) {
                $builder->add('status', new Type\StatusType());
            } else {
                $statusTransformer = new DataTransformer\StatusTransformer();

                $builder
                    ->add(
                        $builder->create('status', 'checkbox', array(
                            'label' => 'Mark solved',
                            'required' => false,
                            'value' => 'closed',
                        ))
                        ->addModelTransformer($statusTransformer)
                    );
//                $builder->add('status', 'checkbox', array(
//                    'label' => 'Mark solved',
//                    'required' => false,
//                    'value' => 'closed',
//                ));
            }
        }
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)<commit_msg>remove commented out code block<commit_after><?php

namespace Hackzilla\Bundle\TicketBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TicketMessageType extends AbstractType
{
    private $_securityContent;
    private $_newTicket;

    public function __construct(SecurityContextInterface $securityContext, $newTicket = false)
    {        
        $this->_securityContent = $securityContext;
        $this->_newTicket = $newTicket;
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
                ->add('message', 'textarea', array(
                    'required' => false,
                ))
                ->add('priority', new Type\PriorityType());

        // if existing ticket add status
        if (!$this->_newTicket) {
            if ($this->_securityContent->isGranted('ROLE_TICKET_ADMIN')) {
                $builder->add('status', new Type\StatusType());
            } else {
                $statusTransformer = new DataTransformer\StatusTransformer();

                $builder
                    ->add(
                        $builder->create('status', 'checkbox', array(
                            'label' => 'Mark solved',
                            'required' => false,
                            'value' => 'closed',
                        ))
                        ->addModelTransformer($statusTransformer)
                    );
            }
        }
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
{'fraction_non_alphanumeric': 0.11031847133757962, 'fraction_numerical': 0.0, 'mean_word_length': 1.8326118326118326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '5255092', 'n_tokens_mistral': 968, 'n_tokens_neox': 924, 'n_words': 185}