<commit_before><?php
/**
 * Form class in /BazeZF/Framework
 *
 * @category   BazeZF_Framework
 * @package    BazeZF
 * @copyright  Copyright (c) 2008 BazeZF
 * @author     <NAME> (hthetiot)
 */

abstract class BaseZF_Framework_Form extends Zend_Form
{
    /**
     * Constructor
     *
     * Registers form view helper as decorator
     *
     * @param mixed $options
     * @return void
     */
    public function __construct($options = null)
    {
        $this->setDisableTranslator(true);

        $this->addElementPrefixPath('BaseZF_Framework', 'BaseZF/Framework/');
        $this->addPrefixPath('BaseZF_Framework_Form_Element', 'BaseZF/Framework/Form/Element/', 'element');
        $this->addPrefixPath('BaseZF_Framework_Form_Decorator', 'BaseZF/Framework/Form/Decorator/', 'decorator');

        parent::__construct($options);

	}

    /**
     * Return a json array or partial validation restults
     */
    public function processJson($formData)
    {
        $response = array();

        if (!$this->isValidPartial($formData)) {
            $response = $this->getMessages();
        }

        // translate it
        foreach ($response as $params => $messages) {

            $translatedMessages = array();
            foreach ($messages as $error => $message) {
                $translatedMessages[$error] = __($message, 'validate');
            }

            $response[$params] = $translatedMessages;
        }

        $params = array_keys($formData);
        foreach ($params as $param) {
            if (!isset($response[$param])) {
                $response[$param] = null;
            }
        }

        return $response;
    }

    /**
     * Set default render
     */
	public function render($content = null)
	{
        $this->setAttrib('class', $this->getAttrib('class') . ' formLayout');

		$defaultDecorators = array(
			'FormElements',
			'Form'
		);

		$defaultGroupDecorators = array(
			'FormElements',
			'Fieldset',
		);

		$this->setElementDecorators(array('Composite'));
		$this->setDisplayGroupDecorators($defaultGroupDecorators);
		$this->setSubFormDecorators($defaultDecorators);
		$this->setDecorators($defaultDecorators);

        return parent::render($content);
	}
}
<commit_msg>fix BaseZF_Framework_Form::render to respect Zend_Form standarts<commit_after><?php
/**
 * Form class in /BazeZF/Framework
 *
 * @category   BazeZF_Framework
 * @package    BazeZF
 * @copyright  Copyright (c) 2008 BazeZF
 * @author     <NAME> (hthetiot)
 */

abstract class BaseZF_Framework_Form extends Zend_Form
{
    /**
     * Constructor
     *
     * Registers form view helper as decorator
     *
     * @param mixed $options
     * @return void
     */
    public function __construct($options = null)
    {
        $this->setDisableTranslator(true);

        $this->addElementPrefixPath('BaseZF_Framework', 'BaseZF/Framework/');
        $this->addPrefixPath('BaseZF_Framework_Form_Element', 'BaseZF/Framework/Form/Element/', 'element');
        $this->addPrefixPath('BaseZF_Framework_Form_Decorator', 'BaseZF/Framework/Form/Decorator/', 'decorator');

        parent::__construct($options);

	}

    /**
     * Return a json array or partial validation restults
     */
    public function processJson($formData)
    {
        $response = array();

        if (!$this->isValidPartial($formData)) {
            $response = $this->getMessages();
        }

        // translate it
        foreach ($response as $params => $messages) {

            $translatedMessages = array();
            foreach ($messages as $error => $message) {
                $translatedMessages[$error] = __($message, 'validate');
            }

            $response[$params] = $translatedMessages;
        }

        $params = array_keys($formData);
        foreach ($params as $param) {
            if (!isset($response[$param])) {
                $response[$param] = null;
            }
        }

        return $response;
    }

    /**
     * Set default render
     */
	public function render(Zend_View_Interface $view = null)
	{
        $this->setAttrib('class', $this->getAttrib('class') . ' formLayout');

		$defaultDecorators = array(
			'FormElements',
			'Form'
		);

		$defaultGroupDecorators = array(
			'FormElements',
			'Fieldset',
		);

		$this->setElementDecorators(array('Composite'));
		$this->setDisplayGroupDecorators($defaultGroupDecorators);
		$this->setSubFormDecorators($defaultDecorators);
		$this->setDecorators($defaultDecorators);

        return parent::render($view);
	}
}

{'fraction_non_alphanumeric': 0.13770201461146778, 'fraction_numerical': 0.0017710870046491033, 'mean_word_length': 2.6406124093473005, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, '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': '6485618', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1321, 'n_words': 246}