<commit_before><?php
// src/PM/WelcomeBundle/Connection/ConnectionListener.php

namespace PM\WelcomeBundle\Connection;

use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Security\Core\SecurityContext;

class ConnectionListener 
{
    protected $em;
    protected $security;
    protected $connectionRedirect;

    public function __construct(EntityManager $EntityManager, SecurityContext $security_context, ConnectionRedirect $connectionRedirect)
    {
        $this->connectionRedirect = $connectionRedirect;
        $this->em = $EntityManager;
        $this->security = $security_context;
    }

    public function onKernelRequest(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
          return;
        }
        
        $response = $event->getResponse();
        
        if ($this->security->getToken() && $this->security->getToken()->getUser() !== 'anon.')
        {
            $current_user = $this->security->getToken()->getUser();
            if(NULL !== $current_user) {
                return;
            }
        }
        
        if($event->getRequest()->get('_route') == "fos_user_security_login") {
            return;
        }<commit_msg>Correctif d'un bug empêchant l'affichage des fichiers générés par asset<commit_after><?php
// src/PM/WelcomeBundle/Connection/ConnectionListener.php

namespace PM\WelcomeBundle\Connection;

use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Security\Core\SecurityContext;

class ConnectionListener 
{
    protected $em;
    protected $security;
    protected $connectionRedirect;

    public function __construct(EntityManager $EntityManager, SecurityContext $security_context, ConnectionRedirect $connectionRedirect)
    {
        $this->connectionRedirect = $connectionRedirect;
        $this->em = $EntityManager;
        $this->security = $security_context;
    }

    public function onKernelRequest(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
          return;
        }
        
        $response = $event->getResponse();
        
        if ($this->security->getToken() && $this->security->getToken()->getUser() !== 'anon.')
        {
            $current_user = $this->security->getToken()->getUser();
            if(NULL !== $current_user) {
                return;
            }
        }
        
        if($event->getRequest()->get('_route') == "fos_user_security_login" OR !preg_match("#^/js/.#", $event->getRequest()->getPathInfo()) OR !preg_match("#^/_wdt/.#", $event->getRequest()->getPathInfo())) {
            return;
        }

{'fraction_non_alphanumeric': 0.13348164627363737, 'fraction_numerical': 0.0, 'mean_word_length': 2.859799713876967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '1787077', 'n_tokens_mistral': 732, 'n_tokens_neox': 723, 'n_words': 121}