<commit_before><?php

/*
 * This file is part of PhpSpec, A php toolset to drive emergent
 * design by specification.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace PhpSpec\Process\ReRunner;

use PhpSpec\Process\ReRunner;

class PassthruReRunner implements ReRunner
{
    /**
     * @return boolean
     */
    public function isSupported()
    {
        return (php_sapi_name() == 'cli') && function_exists('passthru');
    }

    public function reRunSuite()
    {
        $args = $_SERVER['argv'];
        passthru(join(' ', $args), $exitCode);
        exit($exitCode);
    }
}<commit_msg>Escape shell arguments in passthru<commit_after><?php

/*
 * This file is part of PhpSpec, A php toolset to drive emergent
 * design by specification.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace PhpSpec\Process\ReRunner;

use PhpSpec\Process\ReRunner;

class PassthruReRunner implements ReRunner
{
    /**
     * @return boolean
     */
    public function isSupported()
    {
        return (php_sapi_name() == 'cli') && function_exists('passthru');
    }

    public function reRunSuite()
    {
        $args = $_SERVER['argv'];
        $command = join(' ', array_map('escapeshellarg', $args));
        echo($command);exit;
        passthru($command, $exitCode);
        exit($exitCode);
    }
}
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.0, 'mean_word_length': 3.058673469387755, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '5894047', 'n_tokens_mistral': 500, 'n_tokens_neox': 491, 'n_words': 142}