<commit_before><?php
namespace Fminor\Core\Generator;

abstract class GeneratorAbstract
{
	abstract function generate(array $requests, array $parameters);
	protected function create($path, $filename, $content)
	{
		$path = __DIR__.'/../../../../'.$path.'/';
		if (!is_dir($path)) {
			mkdir($path, 0777, true);
		}
		if (file_exists($path.$filename)) {
			unlink($path.$filename);
		}
		file_put_contents($path.$filename, $content);
	}
}<commit_msg>added a function to filter request by class<commit_after><?php
namespace Fminor\Core\Generator;

use Fminor\Core\Config\ParametersManager;

abstract class GeneratorAbstract
{
	abstract function generate(array $requests, ParametersManager $parManager);
	protected function create($path, $filename, $content)
	{
		$path = __DIR__.'/../../../../'.$path.'/';
		if (!is_dir($path)) {
			mkdir($path, 0777, true);
		}
		if (file_exists($path.$filename)) {
			unlink($path.$filename);
		}
		file_put_contents($path.$filename, $content);
	}
	protected function filterBy($requests, $type)
	{
		return array_filter($requests, function($request) {
			return ($request instanceof $type);
		});
	}
}
{'fraction_non_alphanumeric': 0.1762114537444934, 'fraction_numerical': 0.007048458149779736, 'mean_word_length': 4.596059113300493, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '643740', 'n_tokens_mistral': 392, 'n_tokens_neox': 359, 'n_words': 78}