<commit_before><?php

/**
 * This file is part of TwigView.
 *
 ** (c) 2014 <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace WyriHaximus\CakePHP\TwigView\Lib\Twig\Extension;

/**
 * Class Utils
 * @package WyriHaximus\CakePHP\TwigView\Lib\Twig\Extension
 */
class Utils extends \Twig_Extension {

    /**
     * @return array
     */
    public function getFilters() {
		return [
			'serialize' => new \Twig_Filter_Function('serialize'),
			'unserialize' => new \Twig_Filter_Function('unserialize'),
			'md5' => new \Twig_Filter_Function('md5'),
			'base64_encode' => new \Twig_Filter_Function('base64_encode'),
			'base64_decode' => new \Twig_Filter_Function('base64_decode'),
			'nl2br' => new \Twig_Filter_Function('nl2br'),
			'string' => new \Twig_Filter_Function(function($str) {
                return (string) $str;
            }),
		];
	}

    /**
     * @return string
     */<commit_msg>Moved Utils extension filters over to \Twig_SimpleFilter<commit_after><?php

/**
 * This file is part of TwigView.
 *
 ** (c) 2014 <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace WyriHaximus\CakePHP\TwigView\Lib\Twig\Extension;

/**
 * Class Utils
 * @package WyriHaximus\CakePHP\TwigView\Lib\Twig\Extension
 */
class Utils extends \Twig_Extension {

    /**
     * @return array
     */
    public function getFilters() {
		return [
			new \Twig_SimpleFilter('serialize', 'serialize'),
			new \Twig_SimpleFilter('unserialize', 'unserialize'),
			new \Twig_SimpleFilter('md5', 'md5'),
			new \Twig_SimpleFilter('base64_encode', 'base64_encode'),
			new \Twig_SimpleFilter('base64_decode', 'base64_decode'),
			new \Twig_SimpleFilter('nl2br', 'nl2br'),
			new \Twig_SimpleFilter('string', function($str) {
                return (string) $str;
            }),
		];
	}

    /**
     * @return string
     */
{'fraction_non_alphanumeric': 0.1394422310756972, 'fraction_numerical': 0.01593625498007968, 'mean_word_length': 3.3579175704989153, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '500563', 'n_tokens_mistral': 711, 'n_tokens_neox': 657, 'n_words': 148}