<commit_before><?php

namespace Djebbz\BlogBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use  Djebbz\BlogBundle\Entity\Enquiry;
use  Djebbz\BlogBundle\Form\EnquiryType;

class PageController extends Controller
{
    public function indexAction()
    {
        return $this->render('DjebbzBlogBundle:Page:index.html.twig');
    }

    public function aboutAction()
    {
        return $this->render('DjebbzBlogBundle:Page:about.html.twig');
    }

    public function contactAction()
    {
        $enquiry = new Enquiry();
        $form = $this->createForm(new EnquiryType(), $enquiry);
        $request = $this->getRequest();

        if ($request->getMethod() == 'POST') {
            $form->bindRequest($request);

            if ($form->isValid()) {
                return $this->redirect($this->generateUrl('DjebbzBlogBundle_contact'));
            }
        }
        return $this->render('DjebbzBlogBundle:Page:contact.html.twig', array(
            'form' => $form->createView()
        ));
    }
}<commit_msg>Fix an API change (since 2.3) that crashed form submission<commit_after><?php

namespace Djebbz\BlogBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use  Djebbz\BlogBundle\Entity\Enquiry;
use  Djebbz\BlogBundle\Form\EnquiryType;

class PageController extends Controller
{
    public function indexAction()
    {
        return $this->render('DjebbzBlogBundle:Page:index.html.twig');
    }

    public function aboutAction()
    {
        return $this->render('DjebbzBlogBundle:Page:about.html.twig');
    }

    public function contactAction()
    {
        $enquiry = new Enquiry();
        $form = $this->createForm(new EnquiryType(), $enquiry);
        $request = $this->getRequest();

        if ($request->getMethod() == 'POST') {
            $form->handleRequest($request);

            if ($form->isValid()) {
                return $this->redirect($this->generateUrl('DjebbzBlogBundle_contact'));
            }
        }
        return $this->render('DjebbzBlogBundle:Page:contact.html.twig', array(
            'form' => $form->createView()
        ));
    }
}
{'fraction_non_alphanumeric': 0.140995812005584, 'fraction_numerical': 0.0009306654257794323, 'mean_word_length': 2.8324420677361855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '2136049', 'n_tokens_mistral': 675, 'n_tokens_neox': 636, 'n_words': 105}