<commit_before><?php

namespace Easy\Bundle\VentesBundle\Controller;

use Easy\Bundle\VentesBundle\Entity\Product;
use Easy\Bundle\VentesBundle\Form\Type\ProductType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class ProductController extends Controller
{
    public function listAction()
    {
        $em = $this->getDoctrine()->getManager();
        $repos = $em->getRepository('EasyVentesBundle:Product');
        $products = $repos->findAll();
        return $this->render('EasyVentesBundle:Product:list.html.twig', ['products'=> $products]);
    }

    public function detailAction($id)
    {
        $repo = $this->getDoctrine()->getManager()->getRepository('EasyVentesBundle:Product');
        $product = $repo->find($id);

        return $this->render('EasyVentesBundle:Product:detail.html.twig', ['product' => $product]);
    }

    public function addAction(Request $request)
    {
        $form = $this->createForm(new ProductType(), new Product());
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($form->getData());
            $em->flush();
            
            return $this->redirect($this->generateUrl('easy_product_list'));
        }
        return $this->render('EasyVentesBundle:Product:form.html.twig', ['form' => $form->createView()]);
    }
    public function removeAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $repo = $em->getRepository('EasyVentesBundle:Product');
        $product= $repo->find($id);
        $em->remove($product);
        $em->flush();

        return $this->redirect($this->generateUrl("easy_product_list"));
    }

}<commit_msg>test_commit<commit_after><?php

namespace Easy\Bundle\VentesBundle\Controller;

use Easy\Bundle\VentesBundle\Entity\Product;
use Easy\Bundle\VentesBundle\Form\Type\ProductType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class ProductController extends Controller
{
    public function listAction()
    {
        //lol
        $em = $this->getDoctrine()->getManager();
        $repos = $em->getRepository('EasyVentesBundle:Product');
        $products = $repos->findAll();
        return $this->render('EasyVentesBundle:Product:list.html.twig', ['products'=> $products]);
    }

    public function detailAction($id)
    {
        $repo = $this->getDoctrine()->getManager()->getRepository('EasyVentesBundle:Product');
        $product = $repo->find($id);

        return $this->render('EasyVentesBundle:Product:detail.html.twig', ['product' => $product]);
    }

    public function addAction(Request $request)
    {
        $form = $this->createForm(new ProductType(), new Product());
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($form->getData());
            $em->flush();
            
            return $this->redirect($this->generateUrl('easy_product_list'));
        }
        return $this->render('EasyVentesBundle:Product:form.html.twig', ['form' => $form->createView()]);
    }
    public function removeAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $repo = $em->getRepository('EasyVentesBundle:Product');
        $product= $repo->find($id);
        $em->remove($product);
        $em->flush();

        return $this->redirect($this->generateUrl("easy_product_list"));
    }

}
{'fraction_non_alphanumeric': 0.1719356627842485, 'fraction_numerical': 0.0, 'mean_word_length': 3.273696682464455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 71, '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': '1888560', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1022, 'n_words': 151}