@param string $rule
@param string $message

@return $this
334273
public function addValidationMessage($rule, $message)
    {
        if (($pos = strpos($rule, ':')) !== false) {
            $rule = substr($rule, 0, $pos);
        }

        $this->validationMessages[$rule] = $message;

        return $this;
    }
128964
public function setRule($fieldName, Rule $rule)
    {
        $this->rules[$fieldName][get_class($rule)] = $rule;
        
        $rule->setValidator($this);
        
        return $this;
    }
832542
public function withRule(Rule $rule): RulesCollection
    {
        $rules = array_merge($this->rules, [$rule]);

        return new RulesCollection($rules);
    }
1247451
public function addLexerRule($rulename, $rule)
	{
		$this->rules[$rulename] = [];
		$this->rules[$rulename][] = $rule; 
	}
371876
private function addRule($rule, $field, $parameters, $closue = null, $message = null) {

		$this -> rules[] = (object) [

			'rule' 			=> $rule, 
			'field' 		=> $field, 
			'parameters'	=> $parameters,
			'closure'		=> $closue,
			'prefix' 		=> $this -> getPrefix(),
			'message'		=> $message,
			'required' 		=> true
		];
	}
764178
public function triggerError($fieldName, $ruleName, $message)
    {
        $this->triggeredErrors[$fieldName][$ruleName] = $message;
        return $this;
    }
801394
public function set($rule, $action)
    {
        $this->rule = $rule;
        $this->action = $action;

        return $this;
    }
1342746
public function mixin($ruleName, $validator, $message = '')
	{
        if ( ! empty($message))
        {
            $this->messages[$ruleName] = $message;
        }
        Validator::extend($ruleName, $validator);

		return $this;
	}
895570
public function in($rule) {
        $this->check_role = 'in';
        if (!is_array($rule)) {
            $rule = explode(',', $rule);
        }
        $this->rule = '[' . explode(',', $rule) . ']';
        $result = in_array($this->value, $rule);
        $this->checkResult($result);
        return $this;
    }
960899
public function rules($rules)
    {
        foreach ($rules as $rule => $field) {
            if (is_array($field) && is_array($field[0])) {
                foreach ($field as $params) {
                    array_unshift($params, $rule);
                    call_user_func_array([$this, 'rule'], $params);
                }
            } else {
                $this->rule($rule, $field);
            }
        }
        return $this;
    }
536714
public static function instance(array $rules = [], $message = [])
    {
        $key = md5(get_called_class() . serialize($rules) . serialize($message));
        if (! isset(static::$instances[$key])) {
            $instance = new static($rules, $message);
            $instance->instance_key = $key;
            static::$instances[$key] = $instance;
        }
        return static::instanceGet($key);
    }
660415
protected function addItem( $name, $rule = null, $msg = '' )
	{
		if( $rule || 0 === $rule ){
			$this->rule[$name] = $rule;
		} else{
			$this->rule[] = $name;
		}
		$this->message[] = $msg;
		return $this;
	}
263970
public function message($message)
    {
        if (isset($this->currentRule)) {
            static::$messages[$this->input.'.'.$this->currentRule] = $message;
        }

        return $this;
    }
938225
public function regex($rule) {
        $this->check_role = 'regex';
        $this->rule = $rule;
        $result = $this->checkRegex($this->value, $rule);
        $this->checkResult($result);
        return $this;
    }
485843
public function one($value,$rule,$message=[])
    {
        $this->clear();
        $this->from['one']=$value;
        $value=strtolower($rule);
        if(strpos($value, '|')===false){
            $rule=[$value];
        }else{
            $tmp=explode('|',$value);
            $rule=$tmp;
        }
        foreach ($message as $key=>$value){
            $keys=strtolower($key);
            $this->msge['one'][$keys]=$value;
        }
        return $this->checks('one',$rule);
    }
1078731
protected function addRule(FilterRule $rule)
    {
        if ($this->keys === null) {
            $this->filter->addFilterRule($rule);
        }

        if (is_array($this->keys)) {
            foreach ($this->keys as $key) {
                $this->filter->addFilterRule($rule, $key);
            }
        } else {
            $this->filter->addFilterRule($rule, $this->keys);
        }

        return $this;
    }
437576
public function add(FilterRule $rule)
    {
        $this->rules[$rule->getName()] = $rule;

        if (!\is_null($rule->getValue())) {
            $this->hasDefaults = true;
        }

        return $this;
    }