<commit_before><?php

class CoverageCollector
{

	/** @var Mutex */
	private $mutex;

	/** @var ISharedVariable of [mixed $fileId => [$status, $coverage]] */
	private $data;


	public function __construct(Mutex $mutex)
	{
		$this->mutex = $mutex;
//		$this->data = new SharedMemoryVariable($mutex, 50000, []); // TODO fix size
		$this->data = new SharedFileVariable($mutex, []);
	}


	/**
	 * @param callable $cb
	 * @param string   $testId file name or other unique identificator
	 */
	public function collect(callable $cb, $testId)
	{
		$driver = new PHP_CodeCoverage_Driver_PHPDBG();
		$driver->start();

		try {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
			$cb();

		} catch (AssertionError $e) {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE;

		} catch (Error $e) {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR;

		} finally {<commit_msg>fix exit codes<commit_after><?php

class CoverageCollector
{

	/** @var Mutex */
	private $mutex;

	/** @var ISharedVariable of [mixed $fileId => [$status, $coverage]] */
	private $data;


	public function __construct(Mutex $mutex)
	{
		$this->mutex = $mutex;
//		$this->data = new SharedMemoryVariable($mutex, 50000, []); // TODO fix size
		$this->data = new SharedFileVariable($mutex, []);
	}


	/**
	 * @param callable $cb
	 * @param string   $testId file name or other unique identificator
	 */
	public function collect(callable $cb, $testId)
	{
		$driver = new PHP_CodeCoverage_Driver_PHPDBG();
		$driver->start();

		try {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
			$cb();

		} catch (AssertionError $e) {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE;
			throw $e;

		} catch (Error $e) {
			$status = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR;
			throw $e;

		} finally {
{'fraction_non_alphanumeric': 0.14674819344080045, 'fraction_numerical': 0.005558643690939411, 'mean_word_length': 4.09915014164306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6169026', 'n_tokens_mistral': 681, 'n_tokens_neox': 606, 'n_words': 142}