<commit_before><?php
/**
 * Webino (http://webino.sk)
 *
 * @link        https://github.com/webino/WebinoData for the canonical source repository
 * @copyright   Copyright (c) 2012-2014 Webino, s. r. o. (http://webino.sk)
 * @author      <NAME> <<EMAIL>>
 * @license     BSD-3-Clause
 */

namespace WebinoData\Config\InputFilter\Input;

/**
 * String data type
 */
class String extends AbstractInput
{
    use DefaultableTrait;
    use RequirableTrait;

    /**
     * {@inheritDoc}
     */
    protected $spec = [
        'validators' => [
            'length' => [
                'name'    => 'StringLength',
                'options' => ['min' => 0, 'max' => 0],
            ],
        ],
        'filters' => [
            'trim' => ['name' => 'StringTrim'],
        ],
    ];

    /**
     * @param string $name
     */
    public function __construct($name)
    {
        $this->setName($name);
    }

    /**
     * @param int $min
     * @return self
     */
    public function setMin($min)
    {
        empty($min) or $this->setRequired();<commit_msg>Updated Config\InputFilter\Input\String, setMin() greater than zero doesn't set required to true anymore<commit_after><?php
/**
 * Webino (http://webino.sk)
 *
 * @link        https://github.com/webino/WebinoData for the canonical source repository
 * @copyright   Copyright (c) 2012-2014 Webino, s. r. o. (http://webino.sk)
 * @author      <NAME> <<EMAIL>>
 * @license     BSD-3-Clause
 */

namespace WebinoData\Config\InputFilter\Input;

/**
 * String data type
 */
class String extends AbstractInput
{
    use DefaultableTrait;
    use RequirableTrait;

    /**
     * {@inheritDoc}
     */
    protected $spec = [
        'required' => false,
        'validators' => [
            'length' => [
                'name'    => 'StringLength',
                'options' => ['min' => 0, 'max' => 0],
            ],
        ],
        'filters' => [
            'trim' => ['name' => 'StringTrim'],
        ],
    ];

    /**
     * @param string $name
     */
    public function __construct($name)
    {
        $this->setName($name);
    }

    /**
     * @param int $min
     * @return self
     */
    public function setMin($min)
    {
{'fraction_non_alphanumeric': 0.16492503407542025, 'fraction_numerical': 0.009995456610631531, 'mean_word_length': 1.8523316062176165, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '6641000', 'n_tokens_mistral': 707, 'n_tokens_neox': 681, 'n_words': 151}