<commit_before><?php

namespace Illuminated\Testing\Helpers;

use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;

trait InteractsWithConsole
{
    protected function runConsoleCommand($class, array $parameters = [])
    {
        $command = new $class;

        $command->setLaravel($this->app);
        $command->run(new ArrayInput($parameters), new BufferedOutput);

        return $command;
    }
}
<commit_msg>ITT: Ability to pass command object added.<commit_after><?php

namespace Illuminated\Testing\Helpers;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;

trait InteractsWithConsole
{
    protected function runConsoleCommand($command, array $parameters = [])
    {
        if (!($command instanceof Command)) {
            $command = new $command;
        }

        $command->setLaravel($this->app);
        $command->run(new ArrayInput($parameters), new BufferedOutput);

        return $command;
    }
}

{'fraction_non_alphanumeric': 0.1168091168091168, 'fraction_numerical': 0.0, 'mean_word_length': 3.705357142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5199771', 'n_tokens_mistral': 297, 'n_tokens_neox': 297, 'n_words': 60}