<commit_before><?php
namespace filters;

final class URLEncode extends \php_user_filter
{
	function filter($in, $out, &$consumed, $closing)
	{
		while($bucket = stream_bucket_make_writeable($in))
		{
			$consumed += $bucket->datalen;
			$bucket->data = rawurlencode($bucket->data);
			stream_bucket_append($out, $bucket);
		}
		return PSFS_PASS_ON;
	}

	function onCreate()
	{
		return true;
	}
}<commit_msg>I shouldn't be modifying buckets<commit_after><?php
namespace filters;

final class URLEncode extends \php_user_filter
{
	function filter($in, $out, &$consumed, $closing)
	{
		while($bucket = stream_bucket_make_writeable($in))
		{
			$consumed += $bucket->datalen;
			stream_bucket_append($out, stream_bucket_new($this->stream, rawurlencode($bucket->data)));
		}
		return PSFS_PASS_ON;
	}

	function onCreate()
	{
		return true;
	}
}
{'fraction_non_alphanumeric': 0.14149821640903687, 'fraction_numerical': 0.0, 'mean_word_length': 5.1911764705882355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7042319', 'n_tokens_mistral': 329, 'n_tokens_neox': 296, 'n_words': 57}