<commit_before><?php

use Mockista\Mock;
use Mockista\MockBuilder;
use Mockista\MockInterface;
use Mockista\Registry;

/**
 * *****************************************************************************
 * TESTING TOOLS ***************************************************************
 * *****************************************************************************
 */

/**
 * @param Closure $function
 * @return void
 */
function test(Closure $function)
{
	$function();
}

/**
 * @param string $class
 * @param array $defaults
 * @return Mock
 */
function mocki($class = NULL, array $defaults = [])
{
	$builder = new MockBuilder($class, $defaults);

	return $builder->getMock();
}

/**
 * @param string $class
 * @param array $methods
 * @return MockInterface
 */
function mockis($class = NULL, array $methods = [])
{
	return (mockisr()->create($class, $methods));
}

/**
 * @return Registry
 */
function mockisr()
{
	return new Registry();
}<commit_msg>Functions: use only if they dont exist<commit_after><?php

use Mockista\Mock;
use Mockista\MockBuilder;
use Mockista\MockInterface;
use Mockista\Registry;

/**
 * *****************************************************************************
 * TESTING TOOLS ***************************************************************
 * *****************************************************************************
 */

if (!function_exists('test')) {
	/**
	 * @param Closure $function
	 * @return void
	 */
	function test(Closure $function)
	{
		$function();
	}
}

if (!function_exists('mocki')) {
	/**
	 * @param string $class
	 * @param array $defaults
	 * @return Mock
	 */
	function mocki($class = NULL, array $defaults = [])
	{
		$builder = new MockBuilder($class, $defaults);

		return $builder->getMock();
	}
}

if (!function_exists('mockis')) {
	/**
	 * @param string $class
	 * @param array $methods
	 * @return MockInterface
	 */
	function mockis($class = NULL, array $methods = [])
	{
		return (mockisr()->create($class, $methods));
	}
}

if (!function_exists('mockisr')) {
	/**
	 * @return Registry
	 */
	function mockisr()
	{
		return new Registry();
	}
}
{'fraction_non_alphanumeric': 0.34406057737813533, 'fraction_numerical': 0.0, 'mean_word_length': 5.0573065902578795, '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': '6840549', 'n_tokens_mistral': 630, 'n_tokens_neox': 584, 'n_words': 138}