<commit_before><?php

namespace prgTW\ErrorHandlerBundle\Command;

use prgTW\ErrorHandlerBundle\ErrorHandler;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class TestCommand extends ContainerAwareCommand
{
	public $count;

	/** {@inheritdoc} */
	protected function configure()
	{
		$this->setName('error-handler:test');
		$this->addArgument('project', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Project name(s)');
		$this->addOption('count', null, InputOption::VALUE_REQUIRED, 'How many test errors will be created', 1);
		$this->setDescription('Sends a test error to handlers connected to a given project(s)');
	}

	/** {@inheritdoc} */
	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$count    = $input->getOption('count');
		$digits   = floor(log10($count) + 1);
		$projects = $input->getArgument('project');

		/** @var ErrorHandler $errorHandler */
		$errorHandler = $this->getContainer()->get('error_handler');

		$output->writeln('<fg=cyan>Creating errors:</fg=cyan>');
		foreach ($projects as $project)
		{
			$output->writeln(sprintf('- <comment>%s</comment>', $project));
			for ($i = 1; $i <= $count; ++$i)
			{
				$errorHandler->handleError($project, E_USER_ERROR, 'TEST ERROR', __FILE__, __LINE__);
				$output->writeln(sprintf("  - <comment>[%{$digits}d/%{$digits}d]</comment> %s", $i, $count, !empty($eventId) ? sprintf('<info>eventId: %s</info>', $eventId) : '<error>eventId: empty</error>'));
			}
		}

		$output->writeln('<info>DONE</info>');
	}
}<commit_msg>fix command<commit_after><?php

namespace prgTW\ErrorHandlerBundle\Command;

use prgTW\ErrorHandlerBundle\ErrorHandler;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class TestCommand extends ContainerAwareCommand
{
	/** {@inheritdoc} */
	protected function configure()
	{
		$this->setName('error-handler:test');
		$this->addArgument('project', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Project name(s)');
		$this->addOption('count', null, InputOption::VALUE_REQUIRED, 'How many test errors will be created', 1);
		$this->setDescription('Sends a test error to handlers connected to a given project(s)');
	}

	/** {@inheritdoc} */
	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$count    = $input->getOption('count');
		$digits   = floor(log10($count) + 1);
		$errorHandler = $this->getContainer()->get('error_handler');

		$output->writeln('<fg=cyan>Creating errors:</fg=cyan>');
		foreach ($input->getArgument('project') as $project)
		{
			$output->writeln(sprintf('- <comment>%s</comment>', $project));
			for ($i = 1; $i <= $count; ++$i)
			{
				$errorHandler->handleError($project, E_USER_ERROR, 'TEST ERROR', __FILE__, __LINE__);
				$output->writeln(sprintf("  - <comment>[%{$digits}d/%{$digits}d]</comment> %s", $i, $count, !empty($eventId) ? sprintf('<info>eventId: %s</info>', $eventId) : '<error>eventId: empty</error>'));
			}
		}

		$output->writeln('<info>DONE</info>');
	}
}
{'fraction_non_alphanumeric': 0.17846944603083953, 'fraction_numerical': 0.0028555111364934323, 'mean_word_length': 5.936633663366337, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 53, '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': '5734879', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1124, 'n_words': 208}