<commit_before><?php
namespace Biopen\CoreBundle\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

class NewsletterCommand extends ContainerAwareCommand
{
    protected function configure()
    {
       $this
        ->setName('app:users:sendNewsletter')
        ->setDescription('Check for sending the enwsletter to each user')
    ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
      $em = $this->getContainer()->get('doctrine_mongodb.odm.default_document_manager');      
      $usersRepo = $em->getRepository('BiopenCoreBundle:User');
      
      $users = $usersRepo->findNeedsToReceiveNewsletter();

      $nbrUsers = $users->count();

      $newsletterService = $this->getContainer()->get('biopen.newsletter_service');

      foreach ($users as $key => $user)<commit_msg>limit users trated in newsletter<commit_after><?php
namespace Biopen\CoreBundle\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

class NewsletterCommand extends ContainerAwareCommand
{
    protected function configure()
    {
       $this
        ->setName('app:users:sendNewsletter')
        ->setDescription('Check for sending the enwsletter to each user')
    ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
      $em = $this->getContainer()->get('doctrine_mongodb.odm.default_document_manager');      
      $usersRepo = $em->getRepository('BiopenCoreBundle:User');
      
      $users = $usersRepo->findNeedsToReceiveNewsletter();
      $users->limit(70);
      $nbrUsers = $users->count();

      $newsletterService = $this->getContainer()->get('biopen.newsletter_service');

      foreach ($users as $key => $user)
{'fraction_non_alphanumeric': 0.1186833565136764, 'fraction_numerical': 0.0009272137227630969, 'mean_word_length': 4.28921568627451, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '2489882', 'n_tokens_mistral': 606, 'n_tokens_neox': 597, 'n_words': 106}