<commit_before><?php
/**
 * PHP Version 5.4
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 3.0.0
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
namespace Cake\TestSuite;

use \PHPUnit_Extensions_TestDecorator;
use \PHPUnit_Framework_TestResult;
use \PHPUnit_Framework_Test;

/**
 * A decorator class used to run a test case once for each permutation defined
 * in the decorated test suite.
 *
 */
class TestPermutationDecorator extends PHPUnit_Extensions_TestDecorator {

/**
 * An array containing callable methods that will be executed before the test
 * suite is run
 *
 * @var array
 */
	protected $_permutations = [];

/**
 * Constructor
 *
 * @param \PHPUnit_Framework_Test The test or suite to decorate
 * @param array $permutation  An array containing callable methods that will
 * be executed before the test suite is run
 * @return void
 */
	public function __construct(PHPUnit_Framework_Test $test, array $permutations) {
		parent::__construct($test);
		$this->_permutations = $permutations;
	}

/**
 * Returns the count of single test methods that this decorator contains, taking in
 * consideration the possible permutations
 *
 * @return void
 */
	public function count() {
		return count($this->_permutations) * $this->test->count();
	}

/**
 * Runs each of the test methods for this test suite for each of the provided
 * permutations.
 *
 * @param PHPUnit_Framework_TestResult $result
 * @return PHPUnit_Framework_TestResult
 */
	public function run(PHPUnit_Framework_TestResult $result = null) {
		if ($result === NULL) {
            $result = $this->createResult();
		}

		foreach ($this->_permutations as $permutation) {
			if ($result->shouldStop()) {
				break;
			}
			if (is_callable($permutation)) {
				$permutation($this->test);
			}
			$this->test->run($result);
		}

		return $result;
	}

}<commit_msg>Propagating extra params in TestPermutation decorator<commit_after><?php
/**
 * PHP Version 5.4
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 3.0.0
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
namespace Cake\TestSuite;

use \PHPUnit_Extensions_TestDecorator;
use \PHPUnit_Framework_TestResult;
use \PHPUnit_Framework_Test;

/**
 * A decorator class used to run a test case once for each permutation defined
 * in the decorated test suite.
 *
 */
class TestPermutationDecorator extends PHPUnit_Extensions_TestDecorator {

/**
 * An array containing callable methods that will be executed before the test
 * suite is run
 *
 * @var array
 */
	protected $_permutations = [];

/**
 * Constructor
 *
 * @param \PHPUnit_Framework_Test The test or suite to decorate
 * @param array $permutation  An array containing callable methods that will
 * be executed before the test suite is run
 * @return void
 */
	public function __construct(PHPUnit_Framework_Test $test, array $permutations) {
		parent::__construct($test);
		$this->_permutations = $permutations;
	}

/**
 * Returns the count of single test methods that this decorator contains, taking in
 * consideration the possible permutations
 *
 * @return void
 */
	public function count() {
		return count($this->_permutations) * $this->test->count();
	}

/**
 * Runs each of the test methods for this test suite for each of the provided
 * permutations.
 *
 * @param PHPUnit_Framework_TestResult $result
 * @param  mixed $filter
 * @param  array $groups
 * @param  array $excludeGroups
 * @param  boolean $processIsolation
 * @return PHPUnit_Framework_TestResult
 */
	public function run(PHPUnit_Framework_TestResult $result = null, $filter = false, array $groups = [], array $excludeGroups = [], $processIsolation = false) {
		if ($result === NULL) {
            $result = $this->createResult();
		}

		foreach ($this->_permutations as $permutation) {
			if ($result->shouldStop()) {
				break;
			}
			if (is_callable($permutation)) {
				$permutation($this->test);
			}
			$this->test->run($result, $filter, $groups, $excludeGroups, $processIsolation);
		}

		return $result;
	}

}
{'fraction_non_alphanumeric': 0.11117824773413898, 'fraction_numerical': 0.002014098690835851, 'mean_word_length': 3.9363817097415508, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2547228', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1432, 'n_words': 463}