<commit_before><?php

/**
 * Mmi Framework (https://github.com/milejko/mmi.git)
 * 
 * @link       https://github.com/milejko/mmi.git
 * @copyright  Copyright (c) 2010-2015 <NAME> (http://milejko.com)
 * @license    http://milejko.com/new-bsd.txt New BSD License
 */

namespace Mmi\Form\Element;

abstract class ElementAbstract extends Base\Element {

	/**
	 * Automatyczne tłumaczenie opisów i etykiet pól
	 * @var boolean
	 */
	protected $_translatorEnabled = true;

	/**
	 * Błędy pola
	 * @var array
	 */
	protected $_errors = [];

	/**
	 * Formularz macierzysty
	 * @var \Mmi\Form
	 */
	protected $_form = null;

	/**
	 * Konstruktor, ustawia nazwę pola i opcje
	 * @param string $name nazwa
	 * @param array $options opcje
	 */
	public function __construct($name) {
		$this->setName($name)
			->setRequired(false)
			->setRequiredAsterisk('*')
			->setMarkRequired()
			->setLabelPostfix(':')
			->setIgnore(false)
			->setDisableTranslator()
			->init();
	}

	/**
	 * Ustawia form macierzysty
	 * @param \Mmi\Form $form
	 * @return \Mmi\Form\Element\ElementAbstract
	 */
	public final function setForm(\Mmi\Form $form) {
		$this->_form = $form;
		return $this;
	}

	/**
	 * Pobranie formularza macierzystego
	 * @return \Mmi\Form
	 */
	public final function getForm() {
		return $this->_form;
	}

	/**
	 * Wyłącza translator
	 * @param boolean $disable
	 * @return \Mmi\Form\Element\ElementAbstract
	 */
	public final function setDisableTranslator($disable = true) {
		$this->_translatorEnabled = !$disable;
		return $this;
	}

	/**
	 * Pobiera translator
	 * @return \Mmi\Translate
	 */
	public final function getTranslate() {
		$translate = \Mmi\App\FrontController::getInstance()->getView()->getTranslate();
		return (null === $translate) ? new \Mmi\Translate() : $translate;
	}

	/**<commit_msg>fix form<commit_after><?php

/**
 * Mmi Framework (https://github.com/milejko/mmi.git)
 * 
 * @link       https://github.com/milejko/mmi.git
 * @copyright  Copyright (c) 2010-2015 <NAME> (http://milejko.com)
 * @license    http://milejko.com/new-bsd.txt New BSD License
 */

namespace Mmi\Form\Element;

abstract class ElementAbstract extends Base\Element {

	/**
	 * Automatyczne tłumaczenie opisów i etykiet pól
	 * @var boolean
	 */
	protected $_translatorEnabled = true;

	/**
	 * Błędy pola
	 * @var array
	 */
	protected $_errors = [];

	/**
	 * Formularz macierzysty
	 * @var \Mmi\Form\Component
	 */
	protected $_form = null;

	/**
	 * Konstruktor, ustawia nazwę pola i opcje
	 * @param string $name nazwa
	 * @param array $options opcje
	 */
	public function __construct($name) {
		$this->setName($name)
			->setRequired(false)
			->setRequiredAsterisk('*')
			->setMarkRequired()
			->setLabelPostfix(':')
			->setIgnore(false)
			->setDisableTranslator()
			->init();
	}

	/**
	 * Ustawia form macierzysty
	 * @param \Mmi\Form\Component $form
	 * @return \Mmi\Form\Element\ElementAbstract
	 */
	public final function setForm(\Mmi\Form\Component $form) {
		$this->_form = $form;
		return $this;
	}

	/**
	 * Pobranie formularza macierzystego
	 * @return \Mmi\Form\Component
	 */
	public final function getForm() {
		return $this->_form;
	}

	/**
	 * Wyłącza translator
	 * @param boolean $disable
	 * @return \Mmi\Form\Element\ElementAbstract
	 */
	public final function setDisableTranslator($disable = true) {
		$this->_translatorEnabled = !$disable;
		return $this;
	}

	/**
	 * Pobiera translator
	 * @return \Mmi\Translate
	 */
	public final function getTranslate() {
		$translate = \Mmi\App\FrontController::getInstance()->getView()->getTranslate();
		return (null === $translate) ? new \Mmi\Translate() : $translate;
	}

	/**
{'fraction_non_alphanumeric': 0.15574444749108857, 'fraction_numerical': 0.004387167534960241, 'mean_word_length': 3.322274881516588, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, 'https://': 4, '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': '1676745', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1261, 'n_words': 267}