<commit_before><?php declare(strict_types=1);

namespace Gitilicious\GitClient;

class Client
{
    private $gitBinary;

    public function __construct(string $gitBinary)
    {
        $this->gitBinary = $gitBinary;
    }

    public function run(string $path, ...$arguments): CommandResult
    {
        $descriptorspec = [
           ['pipe', 'r'],
           ['pipe', 'w'],
           ['pipe', 'w'],
        ];

        $process = proc_open($this->buildCommand($arguments), $descriptorspec, $pipes, $path);

        $stdOut = stream_get_contents($pipes[1]);
        $stdErr = stream_get_contents($pipes[2]);

        foreach ($pipes as $pipe) {
            fclose($pipe);
        }

        return new CommandResult(proc_close($process), $stdOut, $stdErr);
    }

    private function buildCommand(array $arguments): string
    {
        $command = [];<commit_msg>Fixed CS<commit_after><?php declare(strict_types=1);

namespace Gitilicious\GitClient;

class Client
{
    private $gitBinary;

    public function __construct(string $gitBinary)
    {
        $this->gitBinary = $gitBinary;
    }

    public function run(string $path, ...$arguments): CommandResult
    {
        $descriptorSpec = [
           ['pipe', 'r'],
           ['pipe', 'w'],
           ['pipe', 'w'],
        ];

        $process = proc_open($this->buildCommand($arguments), $descriptorSpec, $pipes, $path);

        $stdOut = stream_get_contents($pipes[1]);
        $stdErr = stream_get_contents($pipes[2]);

        foreach ($pipes as $pipe) {
            fclose($pipe);
        }

        return new CommandResult(proc_close($process), $stdOut, $stdErr);
    }

    private function buildCommand(array $arguments): string
    {
        $command = [];
{'fraction_non_alphanumeric': 0.14789139225880993, 'fraction_numerical': 0.0034662045060658577, 'mean_word_length': 2.5346938775510206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5954073', 'n_tokens_mistral': 520, 'n_tokens_neox': 507, 'n_words': 105}