<commit_before><?php

namespace Vich\Sf2TweetsBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * CleanupTweetsCommand.
 *
 * @author <NAME> <<EMAIL>>
 */
class CleanupTweetsCommand extends ContainerAwareCommand
{
    /**
     * {@inheritDoc}
     */
    protected function configure()
    {
        $this
            ->setName('sf2tweets:cleanup')
            ->setDescription('Cleans up old tweets.')
            ->setHelp(<<<EOT
The <info>sf2t:tweets:cleanup</info> command removes old tweets from the database:

  <info>php app/console sf2tweets:cleanup</info>

EOT
            );
    }
    
    /**
     * {@inheritDoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $manager = $this->getContainer()->get('vich_sf2tweets.tweet_manager');
        
        $counter = 0;
        $batchSize = 50;
        
        $tweets = $manager->findOldTweets();<commit_msg>fixed error in cleanup command<commit_after><?php

namespace Vich\Sf2TweetsBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * CleanupTweetsCommand.
 *
 * @author <NAME> <<EMAIL>>
 */
class CleanupTweetsCommand extends ContainerAwareCommand
{
    /**
     * {@inheritDoc}
     */
    protected function configure()
    {
        $this
            ->setName('sf2tweets:cleanup')
            ->setDescription('Cleans up old tweets.')
            ->setHelp(<<<EOT
The <info>sf2t:tweets:cleanup</info> command removes old tweets from the database:

  <info>php app/console sf2tweets:cleanup</info>

EOT
            );
    }
    
    /**
     * {@inheritDoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $manager = $this->getContainer()->get('vich_sf2tweets.tweet_manager');
        $em = $this->getContainer()->get('doctrine')->getEntityManager();
 
        $counter = 0;
        $batchSize = 50;
        
        $tweets = $manager->findOldTweets();
{'fraction_non_alphanumeric': 0.1291161178509532, 'fraction_numerical': 0.006932409012131715, 'mean_word_length': 2.9948096885813147, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 32, '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': '2400828', 'n_tokens_mistral': 719, 'n_tokens_neox': 704, 'n_words': 121}