<commit_before><?php

namespace Enfi\CienciasDoAmbiente\SiteBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="_home")
     * @Template()
     */
    public function indexAction(Request $request)
    {

        if ($this->get('session')->get('encontrarPontoDeColeta')) {
            $encontrarPontoDeColeta = $this->get('session')->get('encontrarPontoDeColeta');
            $encontrarPontoDeColeta->tipoDeLixo = $this->getDoctrine()->getEntityManager()->merge($encontrarPontoDeColeta->tipoDeLixo);
        } else {
            $encontrarPontoDeColeta = new \Enfi\CienciasDoAmbiente\SiteBundle\ValidationEntity\EncontrarPontoDeColeta;
        }
        $form = $this->createFormBuilder($encontrarPontoDeColeta)
            ->add('tipoDeLixo', 'entity', array('class' => 'Enfi\CienciasDoAmbiente\CommonEntitiesBundle\Entity\TipoDeLixo', 'property' => 'nome', 'label' => 'Tipo de lixo'))
            ->add('endereco', null, array('label' => 'Endereço ou CEP'))
            ->add('submit', 'submit', array('label' => 'Encontre o ponto de coleta mais próximo!'))
            ->getForm();

        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->get('session')->set('encontrarPontoDeColeta', $encontrarPontoDeColeta);
            return $this->redirect($this->generateUrl('_map'));
        }

        return array('form' => $form->createView());
    }

    /**
     * @Route("/sobre", name="_about")
     * @Template()
     */
    public function aboutAction()
    {
        return array();
    }

    /**
     * @Route("/user", name="_user")
     * @Template()
     */
    public function userAction()
    {
        return array();
    }

    /**
     * @Route("/map", name="_map")
     * @Template()
     */
    public function mapAction()
    {
        $encontrarPontoDeColeta = $this->get('session')->get('encontrarPontoDeColeta');

        if (!$encontrarPontoDeColeta) {
            return $this->redirect($this->generateUrl('_home'));
        }

        return array('encontrarPontoDeColeta' => $encontrarPontoDeColeta);
    }
}
<commit_msg>Fix comando obsoleto SF2<commit_after><?php

namespace Enfi\CienciasDoAmbiente\SiteBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="_home")
     * @Template()
     */
    public function indexAction(Request $request)
    {

        if ($this->get('session')->get('encontrarPontoDeColeta')) {
            $encontrarPontoDeColeta = $this->get('session')->get('encontrarPontoDeColeta');
            $encontrarPontoDeColeta->tipoDeLixo = $this->getDoctrine()->getManager()->merge($encontrarPontoDeColeta->tipoDeLixo);
        } else {
            $encontrarPontoDeColeta = new \Enfi\CienciasDoAmbiente\SiteBundle\ValidationEntity\EncontrarPontoDeColeta;
        }
        $form = $this->createFormBuilder($encontrarPontoDeColeta)
            ->add('tipoDeLixo', 'entity', array('class' => 'Enfi\CienciasDoAmbiente\CommonEntitiesBundle\Entity\TipoDeLixo', 'property' => 'nome', 'label' => 'Tipo de lixo'))
            ->add('endereco', null, array('label' => 'Endereço ou CEP'))
            ->add('submit', 'submit', array('label' => 'Encontre o ponto de coleta mais próximo!'))
            ->getForm();

        $form->handleRequest($request);

        if ($form->isValid()) {
            $this->get('session')->set('encontrarPontoDeColeta', $encontrarPontoDeColeta);
            return $this->redirect($this->generateUrl('_map'));
        }

        return array('form' => $form->createView());
    }

    /**
     * @Route("/sobre", name="_about")
     * @Template()
     */
    public function aboutAction()
    {
        return array();
    }

    /**
     * @Route("/user", name="_user")
     * @Template()
     */
    public function userAction()
    {
        return array();
    }

    /**
     * @Route("/map", name="_map")
     * @Template()
     */
    public function mapAction()
    {
        $encontrarPontoDeColeta = $this->get('session')->get('encontrarPontoDeColeta');

        if (!$encontrarPontoDeColeta) {
            return $this->redirect($this->generateUrl('_home'));
        }

        return array('encontrarPontoDeColeta' => $encontrarPontoDeColeta);
    }
}

{'fraction_non_alphanumeric': 0.16168045830681094, 'fraction_numerical': 0.0002121790791427965, 'mean_word_length': 3.049828178694158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, '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': '5630253', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1462, 'n_words': 207}