<commit_before><?php

namespace Phug\DevTool\Command;

use Phug\DevTool\AbstractCommand;
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 CoverageReportCommand extends AbstractCommand
{
    protected function configure()
    {
        $this->setName('coverage:report')
            ->addArgument(
                'input-file',
                InputArgument::REQUIRED,
                'The XML file to report coverage from'
            )
            ->addOption(
                'php-version',
                null,
                InputOption::VALUE_OPTIONAL,
                'If specified, the report is only send for the given PHP version'
            )
            ->setDescription('Reports coverage.')
            ->setHelp('This command reports coverage');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $xmlFile = realpath($input->getArgument('input-file'));

        $phpVersion = $input->getOption('php-version');

        if (empty($phpVersion) || preg_match('/^'.preg_quote($phpVersion).'(\D.*)?$/', PHP_VERSION)) {
            $this->getApplication()->runVendorCommand('test-reporter', [
                "--coverage-report $xmlFile",
            ]);
        }

        return 0;
    }
}
<commit_msg>Make coverage php version option verbose<commit_after><?php

namespace Phug\DevTool\Command;

use Phug\DevTool\AbstractCommand;
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 CoverageReportCommand extends AbstractCommand
{
    protected function configure()
    {
        $this->setName('coverage:report')
            ->addArgument(
                'input-file',
                InputArgument::REQUIRED,
                'The XML file to report coverage from'
            )
            ->addOption(
                'php-version',
                null,
                InputOption::VALUE_OPTIONAL,
                'If specified, the report is only send for the given PHP version'
            )
            ->setDescription('Reports coverage.')
            ->setHelp('This command reports coverage');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $xmlFile = realpath($input->getArgument('input-file'));

        $phpVersion = $input->getOption('php-version');

        if (!empty($phpVersion)) {
            if (!preg_match('/^'.preg_quote($phpVersion).'(\D.*)?$/', PHP_VERSION)) {
                $output->writeln('Test report ignored since PHP version ('.PHP_VERSION.') does not match '.$phpVersion.'.');

                return 0;
            }
            $output->writeln('<fg=green>Proceed test report since PHP version ('.PHP_VERSION.') matches '.$phpVersion.'.</>');
        }

        $this->getApplication()->runVendorCommand('test-reporter', [
            "--coverage-report $xmlFile",
        ]);

        return 0;
    }
}

{'fraction_non_alphanumeric': 0.12488203837684807, 'fraction_numerical': 0.0009436929852154766, 'mean_word_length': 2.281733746130031, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4037274', 'n_tokens_mistral': 850, 'n_tokens_neox': 820, 'n_words': 172}