<commit_before><?php
/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2013 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget\Validator;

/**
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 */
class MinLength extends AbstractLengthValidator
{
    protected $minMessage = '%name% must have a length greater than %min%';
    
    protected $minItemMessage = '%name% must contain at least %min% item(s)';
    
    protected $min;

    public function __invoke($input, $min = null)
    {
        $min && $this->min = $min;
        
        if (false === ($len = $this->getLength($input))) {
            $this->addError('notDetectd');
            return false;
        }
        
        if ($this->min > $len) {
            $this->addError(is_scalar($input) ? 'min' : 'minItem');
            return false;
        }
        
        return true;
    }
}<commit_msg>renamed message property name to more meaningful<commit_after><?php
/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2013 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget\Validator;

/**
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 */
class MinLength extends AbstractLengthValidator
{
    protected $tooShortMessage = '%name% must have a length greater than %min%';
    
    protected $tooFewMessage = '%name% must contain at least %min% item(s)';
    
    protected $min;

    public function __invoke($input, $min = null)
    {
        $min && $this->min = $min;
        
        if (false === ($len = $this->getLength($input))) {
            $this->addError('notDetectd');
            return false;
        }
        
        if ($this->min > $len) {
            $this->addError(is_scalar($input) ? 'tooShort' : 'tooFew');
            return false;
        }
        
        return true;
    }
}
{'fraction_non_alphanumeric': 0.14545454545454545, 'fraction_numerical': 0.01038961038961039, 'mean_word_length': 2.1940298507462686, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6940506', 'n_tokens_mistral': 588, 'n_tokens_neox': 570, 'n_words': 144}