<commit_before><?php

namespace App\Controller\EspacePerso;

use App\App\SocialManager;
use App\Entity\User;
use App\Factory\EventFactory;
use App\Handler\DoctrineEventHandler;
use App\Parser\Common\FaceBookParser;
use App\Social\FacebookAdmin;
use App\Social\FacebookListEvents;
use App\Social\SocialProvider;
use App\Validator\Constraints\EventConstraintValidator;
use Psr\Log\LoggerInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use App\Controller\TBNController as Controller;
use App\Entity\Agenda;
use App\Handler\ExplorationHandler;
use App\Form\Type\AgendaType;
use App\Entity\Calendrier;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class EventController extends Controller
{
    /**
     * @Route("/annuler/{slug}", name="tbn_agenda_annuler", requirements={"slug": ".+"})
     *
     * @param Request $request
     * @param Agenda  $agenda
     *
     * @return JsonResponse
     */
    public function annulerAction(Request $request, Agenda $agenda)
    {
        $this->checkIfOwner($agenda);

        $annuler                    = $request->get('annuler', 'true');
        $modificationDerniereMinute = ('true' === $annuler ? 'ANNULÉ' : null);

        $em = $this->getDoctrine()->getManager();
        $agenda->setModificationDerniereMinute($modificationDerniereMinute)->setDateModification(new \DateTime());
        $em->merge($agenda);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }

    /**
     * @Route("/brouillon/{slug}", name="tbn_agenda_brouillon", requirements={"slug": ".+"})
     *
     * @param Request $request
     * @param Agenda  $agenda
     *
     * @return JsonResponse
     */
    public function brouillonAction(Request $request, Agenda $agenda)
    {
        $this->checkIfOwner($agenda);

        $brouillon   = $request->get('brouillon', 'true');
        $isBrouillon = ('true' === $brouillon);

        $em = $this->getDoctrine()->getManager();
        $agenda->setBrouillon($isBrouillon)->setDateModification(new \DateTime());
        $em->merge($agenda);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }

    /**
     * @Route("/mes-soirees", name="tbn_agenda_list")
     */
    public function indexAction()
    {
        $user    = $this->getUser();
        $soirees = $this->getDoctrine()->getRepository(Agenda::c)->findAllByUser($user);

        $canSynchro = $user->hasRole('ROLE_FACEBOOK_LIST_EVENTS');

        return $this->render('EspacePerso/liste.html.twig', [
            'soirees'    => $soirees,
            'canSynchro' => $canSynchro,
        ]);
    }

    /**
     * @Route("/supprimer/{id}", name="tbn_agenda_delete", requirements={"id": "\d+"})
     *
     * @param Agenda $agenda
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
     */
    public function deleteAction(Agenda $agenda)
    {
        $this->checkIfOwner($agenda);
        $em = $this->getDoctrine()->getManager();
        $em->remove($agenda);
        $em->flush();

        $this->addFlash(
            'success',
            'Votre événement a bien été supprimé'
        );
<commit_msg>Fix doctrineManager call typo<commit_after><?php

namespace App\Controller\EspacePerso;

use App\App\SocialManager;
use App\Entity\User;
use App\Factory\EventFactory;
use App\Handler\DoctrineEventHandler;
use App\Parser\Common\FaceBookParser;
use App\Social\FacebookAdmin;
use App\Social\FacebookListEvents;
use App\Social\SocialProvider;
use App\Validator\Constraints\EventConstraintValidator;
use Psr\Log\LoggerInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use App\Controller\TBNController as Controller;
use App\Entity\Agenda;
use App\Handler\ExplorationHandler;
use App\Form\Type\AgendaType;
use App\Entity\Calendrier;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class EventController extends Controller
{
    /**
     * @Route("/annuler/{slug}", name="tbn_agenda_annuler", requirements={"slug": ".+"})
     *
     * @param Request $request
     * @param Agenda  $agenda
     *
     * @return JsonResponse
     */
    public function annulerAction(Request $request, Agenda $agenda)
    {
        $this->checkIfOwner($agenda);

        $annuler                    = $request->get('annuler', 'true');
        $modificationDerniereMinute = ('true' === $annuler ? 'ANNULÉ' : null);

        $em = $this->getDoctrine()->getManager();
        $agenda->setModificationDerniereMinute($modificationDerniereMinute)->setDateModification(new \DateTime());
        $em->merge($agenda);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }

    /**
     * @Route("/brouillon/{slug}", name="tbn_agenda_brouillon", requirements={"slug": ".+"})
     *
     * @param Request $request
     * @param Agenda  $agenda
     *
     * @return JsonResponse
     */
    public function brouillonAction(Request $request, Agenda $agenda)
    {
        $this->checkIfOwner($agenda);

        $brouillon   = $request->get('brouillon', 'true');
        $isBrouillon = ('true' === $brouillon);

        $em = $this->getDoctrine()->getManager();
        $agenda->setBrouillon($isBrouillon)->setDateModification(new \DateTime());
        $em->merge($agenda);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }

    /**
     * @Route("/mes-soirees", name="tbn_agenda_list")
     */
    public function indexAction()
    {
        $user    = $this->getUser();
        $soirees = $this->getDoctrine()->getRepository(Agenda::class)->findAllByUser($user);

        $canSynchro = $user->hasRole('ROLE_FACEBOOK_LIST_EVENTS');

        return $this->render('EspacePerso/liste.html.twig', [
            'soirees'    => $soirees,
            'canSynchro' => $canSynchro,
        ]);
    }

    /**
     * @Route("/supprimer/{id}", name="tbn_agenda_delete", requirements={"id": "\d+"})
     *
     * @param Agenda $agenda
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
     */
    public function deleteAction(Agenda $agenda)
    {
        $this->checkIfOwner($agenda);
        $em = $this->getDoctrine()->getManager();
        $em->remove($agenda);
        $em->flush();

        $this->addFlash(
            'success',
            'Votre événement a bien été supprimé'
        );

{'fraction_non_alphanumeric': 0.14970397519030165, 'fraction_numerical': 0.0, 'mean_word_length': 3.248502994011976, 'pattern_counts': {'":': 6, '<': 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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '817055', 'n_tokens_mistral': 2212, 'n_tokens_neox': 2167, 'n_words': 343}