<commit_before><?php
/**
 * This file is part of the BEAR.Package package
 *
 * @license http://opensource.org/licenses/bsd-license.php BSD
 */
namespace BEAR\Package\Provide\TemplateEngine\Twig\Extension;

use Aura\Html\HelperLocatorFactory;

class AuraForm_Twig_Extension extends \Twig_Extension
{
    private static $helper;

    public function getName()
    {
        return 'AuraForm';
    }

    public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('form', [$this, 'createForm']),
        ];
    }

    public function createForm($hint)
    {
        if (! static::$helper) {
            $factory = new HelperLocatorFactory();
            static::$helper = $factory->newInstance();
        }

        $formElementHtml = static::$helper->input($hint);
        return $formElementHtml;
    }
}<commit_msg>Add is_safe option to Twig "form" function for AuraForm<commit_after><?php
/**
 * This file is part of the BEAR.Package package
 *
 * @license http://opensource.org/licenses/bsd-license.php BSD
 */
namespace BEAR\Package\Provide\TemplateEngine\Twig\Extension;

use Aura\Html\HelperLocatorFactory;

class AuraForm_Twig_Extension extends \Twig_Extension
{
    private static $helper;

    public function getName()
    {
        return 'AuraForm';
    }

    public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction(
                'form',
                [$this, 'createForm'],
                ['is_safe' => ['html']]
            ),
        ];
    }

    public function createForm($hint)
    {
        if (! static::$helper) {
            $factory = new HelperLocatorFactory();
            static::$helper = $factory->newInstance();
        }

        $formElementHtml = static::$helper->input($hint);
        return $formElementHtml;
    }
}
{'fraction_non_alphanumeric': 0.12219178082191781, 'fraction_numerical': 0.0, 'mean_word_length': 2.3814814814814813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '4741371', 'n_tokens_mistral': 532, 'n_tokens_neox': 523, 'n_words': 111}