<commit_before><?php

namespace Dodici\Fansworld\WebBundle\Controller;

use Symfony\Component\Form\FormError;
use Symfony\Component\Validator\Constraints\Collection;
use JMS\SecurityExtraBundle\Annotation\Secure;
use Doctrine\ORM\EntityManager;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Dodici\Fansworld\WebBundle\Entity\Notification;
use Dodici\Fansworld\WebBundle\Controller\SiteController;
use Symfony\Component\HttpFoundation\Request;

/**
 * Notification controller.
 * @Route("/notification")
 */
class NotificationController extends SiteController
{
    const LIMIT_NOTIFICATIONS = 30;
    
    /**
     * Only for testing purpose
     * @Route("/test", name="notification_test")
     */
//    public function testAction(){
//      $notification = $this->getRepository('Notification')->findOneBy(array());
//      
//      $html = $this->render(
//                'DodiciFansworldWebBundle:Notification:Mail/'.$notification->getTypeName().'.html.twig', 
//                array(
//                    'notification' => $notification, 
//                    'targetUser' => $notification->getTarget()
//                )
//              ); 
//     
//      $this->get('fansworldmailer')->send('<EMAIL>', '[BENCH] fw mail test', $html);
//      
//      return $html;
//    }


    /**
     * @Route("/testregister", name="notification_test_register")
     * @Secure(roles="ROLE_USER")
     */
    public function testAction(){
        $user = $this->getUser();        
      $html = $this->render(
                'DodiciFansworldWebBundle:Mail:welcome.html.twig', 
                array('targetUser' => $user)
              ); 
     
     $this->get('fansworldmailer')->send('<EMAIL>', '[BENCH] fw mail test', $html);
      
      return $html;
    }    

    /**
     * @Route("/preferences", name="notification_preferences")
     * @Secure(roles="ROLE_USER")<commit_msg>131-mail_bienvenida<commit_after><?php

namespace Dodici\Fansworld\WebBundle\Controller;

use Symfony\Component\Form\FormError;
use Symfony\Component\Validator\Constraints\Collection;
use JMS\SecurityExtraBundle\Annotation\Secure;
use Doctrine\ORM\EntityManager;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Dodici\Fansworld\WebBundle\Entity\Notification;
use Dodici\Fansworld\WebBundle\Controller\SiteController;
use Symfony\Component\HttpFoundation\Request;

/**
 * Notification controller.
 * @Route("/notification")
 */
class NotificationController extends SiteController
{
    const LIMIT_NOTIFICATIONS = 30;
    
    /**
     * Only for testing purpose
     * @Route("/test", name="notification_test")
     */
//    public function testAction(){
//      $notification = $this->getRepository('Notification')->findOneBy(array());
//      
//      $html = $this->render(
//                'DodiciFansworldWebBundle:Notification:Mail/'.$notification->getTypeName().'.html.twig', 
//                array(
//                    'notification' => $notification, 
//                    'targetUser' => $notification->getTarget()
//                )
//              ); 
//     
//      $this->get('fansworldmailer')->send('<EMAIL>', '[BENCH] fw mail test', $html);
//      
//      return $html;
//    }


    /**
     * @Route("/testregister", name="notification_test_register")
     * @Secure(roles="ROLE_USER")
     */
    //public function testAction(){
    //    $user = $this->getUser();        
    //  $html = $this->render(
    //            'DodiciFansworldWebBundle:Mail:welcome.html.twig', 
    //            array('targetUser' => $user)
    //          ); 
    // 
    // $this->get('fansworldmailer')->send('<EMAIL>', '[BENCH] fw mail test', $html);
    //  
    //  return $html;
    //}    

    /**
     * @Route("/preferences", name="notification_preferences")
     * @Secure(roles="ROLE_USER")
{'fraction_non_alphanumeric': 0.15321828358208955, 'fraction_numerical': 0.0016324626865671641, 'mean_word_length': 2.78886925795053, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, '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': '1373689', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1241, 'n_words': 175}