<commit_before><?php

/**
 * MvcCore
 *
 * This source file is subject to the BSD 3 License
 * For the full copyright and license information, please view
 * the LICENSE.md file that are distributed with this source code.
 *
 * @copyright	Copyright (c) 2016 <NAME> (https://github.com/mvccore/mvccore)
 * @license		https://mvccore.github.io/docs/mvccore/4.0.0/LICENCE.md
 */

namespace MvcCore\Ext\Forms;

/**
 * Responsibility: init, predispatch and render group of common form controls, 
 *				   mostly `input` controls. This class is not possible to 
 *				   instantiate, you need to extend this class to create own 
 *				   specific form control.
 */
abstract class FieldsGroup 
	extends		\MvcCore\Ext\Forms\Field
	implements	\MvcCore\Ext\Forms\Fields\IVisibleField, 
				\MvcCore\Ext\Forms\Fields\ILabel,
				\MvcCore\Ext\Forms\Fields\IOptions,
				\MvcCore\Ext\Forms\Fields\IMultiple,
				\MvcCore\Ext\Forms\IFieldsGroup
{
	use \MvcCore\Ext\Forms\Field\Props\VisibleField;
	use \MvcCore\Ext\Forms\Field\Props\Label;
	use \MvcCore\Ext\Forms\Field\Props\Options;
	use \MvcCore\Ext\Forms\Field\Props\GroupLabelCssClasses;
	use \MvcCore\Ext\Forms\Field\Props\GroupLabelAttrs;
	
	/**
	 * Form group pseudo control type,
	 * unique type accross all form field types.
	 * @var string|NULL
	 */
	protected $type = NULL;

	/**
	 * Form group controls value, in most cases it's an array of strings.
	 * For extended class `RadioGroup` - the type is only a `string` or `NULL`.
	 * @var \string[]|NULL
	 */
	protected $value = [];
	
	/**
	 * Form group control options to render
	 * more sub-control attributes for specified
	 * submitted values (array keys).
	 * This property configuration is required.
	 * 
	 * Example:
	 * ```
	 * // To configure for example radio buttons named: `gender` for `Female` and `Male`:
	 * //   <label for="gender-f">Female:</label>
	 * //   <input id="gender-f" type="radio" name="gender" value="f" />
	 * //   <label for="gender-m">Male:</label>
	 * //   <input id="gender-m" type="radio" name="gender" value="m" />
	 * // use this configuration:
	 * $field->name = 'gender';
	 * $field->options = array(
	 *	 'f' => 'Female',
	 *	 'm' => 'Male',
	 * );
	 *
	 * // Or you can use more adwanced configuration with css class names 
	 * // and html element attributes, let's consider html code like this:
	 * //   <label for="gender-f" class="female">Female:</label>
	 * //   <input id="gender-f" type="radio" name="gender" value="f" class="female" data-any="something-for-females" />
	 * //   <label for="gender-m" class="male">Male:</label>
	 * //   <input id="gender-m" type="radio" name="gender" value="m" class="male" data-any="something-for-males" />
	 * // For that use this configuration:
	 * $field->name = 'gender';
	 * $field->options = array(
	 *	 'f' => array(
	 *		 'text'  => 'Female',	// text key will be also automaticly translated
	 *		 'class' => 'female',
	 *		 'attrs' => array('data-any' => 'something-for-females'),
	 *	 ),
	 *	 'm' => array(
	 *		 'text'  => 'Male', // text key will be also automaticly translated
	 *		 'class' => 'male',
	 *		 'attrs' => array('data-any' => 'something-for-males'),
	 *	 ),
	 * ));
	 * ```
	 * @requires
	 * @var array
	 */
	protected $options = [];<commit_msg>bugfix<commit_after><?php

/**
 * MvcCore
 *
 * This source file is subject to the BSD 3 License
 * For the full copyright and license information, please view
 * the LICENSE.md file that are distributed with this source code.
 *
 * @copyright	Copyright (c) 2016 <NAME> (https://github.com/mvccore/mvccore)
 * @license		https://mvccore.github.io/docs/mvccore/4.0.0/LICENCE.md
 */

namespace MvcCore\Ext\Forms;

/**
 * Responsibility: init, predispatch and render group of common form controls, 
 *				   mostly `input` controls. This class is not possible to 
 *				   instantiate, you need to extend this class to create own 
 *				   specific form control.
 */
abstract class FieldsGroup 
	extends		\MvcCore\Ext\Forms\Field
	implements	\MvcCore\Ext\Forms\Fields\IVisibleField, 
				\MvcCore\Ext\Forms\Fields\ILabel,
				\MvcCore\Ext\Forms\Fields\IOptions,
				\MvcCore\Ext\Forms\Fields\IMultiple,
				\MvcCore\Ext\Forms\IFieldsGroup
{
	use \MvcCore\Ext\Forms\Field\Props\VisibleField;
	use \MvcCore\Ext\Forms\Field\Props\Label;
	use \MvcCore\Ext\Forms\Field\Props\Options;
	use \MvcCore\Ext\Forms\Field\Props\GroupLabelCssClasses;
	use \MvcCore\Ext\Forms\Field\Props\GroupLabelAttrs;
	
	/**
	 * Form group pseudo control type,
	 * unique type accross all form field types.
	 * @var string|NULL
	 */
	protected $type = NULL;

	/**
	 * Form group controls value, in most cases it's an array of strings.
	 * For extended class `RadioGroup` - the type is only a `string` or `NULL`.
	 * @var \string[]|NULL
	 */
	protected $value = [];
{'fraction_non_alphanumeric': 0.1489539748953975, 'fraction_numerical': 0.0033472803347280333, 'mean_word_length': 3.2384751773049647, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 33, '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': '4610421', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1547, 'n_words': 423}