<commit_before><?php
namespace Scheb\Tombstone\Analyzer\Report\Console;

use Scheb\Tombstone\Tombstone;
use Symfony\Component\Console\Output\OutputInterface;

class FormattedConsoleOutput
{
    /**
     * @var OutputInterface
     */
    private $output;

    /**
     * @param OutputInterface $output
     */
    public function __construct(OutputInterface $output)
    {
        $this->output = $output;
    }

    /**
     * @param $text
     */
    public function writeln($text)
    {
        $this->output->writeln($text);
    }

    public function newLine()
    {
        $this->writeln('');
    }

    /**
     * @param Tombstone $tombstone
     */
    public function printTombstone($tombstone, $prefix)
    {
        $label = $tombstone->getLabel() ? ', "' . $tombstone->getLabel() . '"' : '';
        $this->output->writeln(sprintf('  [%s] <info>tombstone("%s", "%s"%s)</info>', $prefix, $tombstone->getTombstoneDate(), $tombstone->getAuthor(), $label));
        $this->output->writeln(sprintf('    in <comment>line %s</comment>', $tombstone->getLine()));
        if ($tombstone->getMethod()) {
            $this->output->writeln(sprintf('    in method <comment>%s</comment>', $tombstone->getMethod()));
        } else {
            $this->output->writeln(sprintf('  in global scope'));
        }
    }

    /**
     * @param string[] $invokers
     */
    public function printCalledBy(array $invokers) {
        foreach ($invokers as $invoker) {
            $this->output->writeln(sprintf('    was called by <error>%s</error>', $invoker ?: 'global scope'));
        }
    }
}
<commit_msg>Use tombstone toString<commit_after><?php
namespace Scheb\Tombstone\Analyzer\Report\Console;

use Scheb\Tombstone\Tombstone;
use Symfony\Component\Console\Output\OutputInterface;

class FormattedConsoleOutput
{
    /**
     * @var OutputInterface
     */
    private $output;

    /**
     * @param OutputInterface $output
     */
    public function __construct(OutputInterface $output)
    {
        $this->output = $output;
    }

    /**
     * @param $text
     */
    public function writeln($text)
    {
        $this->output->writeln($text);
    }

    public function newLine()
    {
        $this->writeln('');
    }

    /**
     * @param Tombstone $tombstone
     */
    public function printTombstone($tombstone, $prefix)
    {
        $this->output->writeln(sprintf('  [%s] <info>%s</info>', $prefix, (string) $tombstone));
        $this->output->writeln(sprintf('    in <comment>line %s</comment>', $tombstone->getLine()));
        if ($tombstone->getMethod()) {
            $this->output->writeln(sprintf('    in method <comment>%s</comment>', $tombstone->getMethod()));
        } else {
            $this->output->writeln(sprintf('  in global scope'));
        }
    }

    /**
     * @param string[] $invokers
     */
    public function printCalledBy(array $invokers) {
        foreach ($invokers as $invoker) {
            $this->output->writeln(sprintf('    was called by <error>%s</error>', $invoker ?: 'global scope'));
        }
    }
}

{'fraction_non_alphanumeric': 0.1714005876591577, 'fraction_numerical': 0.0, 'mean_word_length': 2.5097365406643757, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 57, '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': '925166', 'n_tokens_mistral': 957, 'n_tokens_neox': 969, 'n_words': 169}