<commit_before><?php

namespace App\Controller;

use App\Annotation\ReverseProxy;
use App\App\CityManager;
use App\Entity\Event;
use App\Form\Type\CityAutocompleteType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends AbstractController
{
    const EVENT_PER_CATEGORY = 7;

    /**
     * @Route("/", name="app_main_index")
     * @ReverseProxy(expires="tomorrow")
     *
     * @return Response
     */
    public function indexAction(Request $request, CityManager $cityManager)
    {
        $datas = [];
        if ($city = $cityManager->getCity()) {
            $datas = [
                'name' => $city->getFullName(),
                'city' => $city->getSlug(),
            ];
        }

        $stats = $this->getDoctrine()->getManager()->getRepository(Event::class)->getCountryEvents();
        $form = $this->createForm(CityAutocompleteType::class, $datas);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $datas = $form->getData();

            return $this->redirectToRoute('app_agenda_index', ['location' => $datas['city']]);
        }

        return $this->render('Default/index.html.twig', [
            'autocomplete_form' => $form->createView(),
            'stats' => $stats,
        ]);
    }
}<commit_msg>Updated landing page destination<commit_after><?php

namespace App\Controller;

use App\Annotation\ReverseProxy;
use App\App\CityManager;
use App\Entity\Event;
use App\Form\Type\CityAutocompleteType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends AbstractController
{
    const EVENT_PER_CATEGORY = 7;

    /**
     * @Route("/", name="app_main_index")
     * @ReverseProxy(expires="tomorrow")
     *
     * @return Response
     */
    public function indexAction(Request $request, CityManager $cityManager)
    {
        $datas = [];
        if ($city = $cityManager->getCity()) {
            $datas = [
                'name' => $city->getFullName(),
                'city' => $city->getSlug(),
            ];
        }

        $stats = $this->getDoctrine()->getManager()->getRepository(Event::class)->getCountryEvents();
        $form = $this->createForm(CityAutocompleteType::class, $datas);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $datas = $form->getData();

            return $this->redirectToRoute('app_agenda_agenda', ['location' => $datas['city']]);
        }

        return $this->render('Default/index.html.twig', [
            'autocomplete_form' => $form->createView(),
            'stats' => $stats,
        ]);
    }
}
{'fraction_non_alphanumeric': 0.15220207253886012, 'fraction_numerical': 0.0006476683937823834, 'mean_word_length': 2.990956072351421, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '5508941', 'n_tokens_mistral': 905, 'n_tokens_neox': 875, 'n_words': 141}