Validate the rule against the value

@return mixed
344008
public function validate()
    {
        $confirmationInput = $this->inputName.'_confirmation';

        if (isset($this->input[$confirmationInput]) &&
            $this->input[$confirmationInput] == $this->getValue()) {
            return true;
        }

        return false;
    }
343208
public function validate() {
	
		$app = Application::getInstance();
		
		$valid = TRUE;
	
		$value = Input::get($this->name);

		// checks if empty and required
		if ($this->required and !$value) {
			
			$app->logWarning('Control validation on field “' . $this->name . '” has failed (required)');
			$valid = FALSE;
			
		// checks if value is in allowed list
		} else if (count($this->list)) {
			
			$valid = FALSE;
			
			foreach ($this->list as $item) {
				if ($item->value == $value) $valid = TRUE;
			}

			if (!$valid) {
				$app->logWarning('Control validation on field “' . $this->name . '” has failed (value “' . $value . '” is not in list)');
			}

		}
		
		return $valid;
	
	}
139598
private function validateGreaterThan(): bool
    {
        if ($this->options['inclusive'] === true) {
            $isValid = \mb_strlen($this->value, 'UTF-8') >= $this->options['length'] ? true : false;
            if (!$isValid) {
                $this->setError(self::VALIDATOR_ERROR_STRING_LENGTH_MUST_BE_HIGHER_OR_EQUAL_TO_MIN);
            }
            return $isValid;
        }

        $isValid = \mb_strlen($this->value, 'UTF-8') > $this->options['length'] ? true : false;
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_STRING_LENGTH_MUST_BE_HIGHER_THAN_MIN);
        }
        return $isValid;
    }
1067137
public function Validate()
	{
		// force re-validation
		$this->ResetValidationErrors();

		$is_valid = (!$this->HasValidationErrors());

		// if validation fails, remove this object from the cache otherwise invalid values can
		// hang around and cause troubles.
		if (!$is_valid)
		{
			$this->_phreezer->DeleteCache(get_class($this), $this->GetPrimaryKeyValue());
		}

		return $is_valid;
	}
22303
public function validate()
    {
        $same = $this->getArg(0);

        return isset($this->input[$same]) && $this->input[$same] == $this->getValue();
    }
41723
public function validate(): bool
    {
        foreach ($this as $element) {
            if ($element instanceof HasValueValidationInterface) {
                $element->validate();
            }
        }
        return $this->errors()->empty();
    }
1055734
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if the field contains a valid number value.
        if (!preg_match('/^-?\d+$/', $value)) {
            return false;
        }

        // check if the value is not to low.
        if ($this->min !== null) {
            if ($value < $this->min) {
                return false;
            }
        }

        // check if the value is not to high.
        if ($this->max !== null) {
            if ($value > $this->max) {
                return false;
            }
        }

        return true;
    }
1259205
public function validate()
    {
        // Names must not be empty, but can be 0
        $name = $this->getName();
        if (empty($name) && !is_numeric($name)) {
            return 'The cookie name must not be empty';
        }

        // Check if any of the invalid characters are present in the cookie name
        if (strpbrk($name, self::getInvalidCharacters()) !== false) {
            return 'The cookie name must not contain invalid characters: ' . $name;
        }

        // Value must not be empty, but can be 0
        $value = $this->getValue();
        if (empty($value) && !is_numeric($value)) {
            return 'The cookie value must not be empty';
        }

        // Domains must not be empty, but can be 0
        // A "0" is not a valid internet domain, but may be used as server name in a private network
        $domain = $this->getDomain();
        if (empty($domain) && !is_numeric($domain)) {
            return 'The cookie domain must not be empty';
        }

        return true;
    }
1163748
public function validates()
    {
        $currentAttributeValues = array();

        if ($this->isBound()) {
            foreach ($this->getAttributeNames() as $name) {
                $currentAttributeValues[$name] = $this->{$name};
            }
        }

        return $this->validate(array(
            $this->getInputName() => $currentAttributeValues
        ));
    }
198669
public function validate()
    {
        foreach ($this->dateBindRule as $bind) {
            foreach ($bind['field'] as $field) {
                if (strpos($field, '.')) {
                    $values = Cml::doteToArr($field, $this->data);
                } else {
                    $values = isset($this->data[$field]) ? $this->data[$field] : null;
                }

                if (isset(static::$rules[$bind['rule']])) {
                    $callback = static::$rules[$bind['rule']];
                } else {
                    $callback = [$this, 'is' . ucfirst($bind['rule'])];
                }

                $result = true;
                if ($bind['rule'] == 'arr') {
                    $result = call_user_func($callback, $values, $bind['params'], $field);
                } else {
                    is_array($values) || $values = [$values];// GET|POST的值为数组的时候每个值都进行校验
                    foreach ($values as $value) {
                        $result = $result && call_user_func($callback, $value, $bind['params'], $field);
                        if (!$result) {
                            break;
                        }
                    }
                }

                if (!$result) {
                    $this->error($field, $bind);
                }
            }
        }

        return count($this->getErrors()) === 0;
    }
910636
public function validate()
	{
		$validity = Rules::validate($this->attributes, $this->getRules());

		if ($validity === true)
		{
			return true;
		}

		$this->setErrors($validity);
		return false;
	}
111065
protected function validate()
    {
        if (!CommonUtils::isRegexExpr($this->pattern)) {
            return false;
        }

        return (bool) preg_match(
            $this->pattern,
            $this->getRequestValue()
        );
    }
539018
public function getRule()
    {
        $rules = [];
        if ($this->isRequired()) {
            $rules[] = 'required';
        }
        if ($this->getValidations()) {
            $rules[] = $this->getValidations();
        }

        $rules = join('|', $rules);
        return $rules;
    }
1062763
protected function validateSubtractProduct()
    {
        $field = 'subtract';
        $value = $this->getSubmitted($field);

        if (isset($value)) {
            $this->setSubmitted($field, filter_var($value, FILTER_VALIDATE_BOOLEAN));
        }

        return true;
    }
1222545
public function validationRules():array
    {
        $rules = [];

        foreach ($this as $control) {
            $rule = $control->getRule();
            if (!empty($rule)) {
                $rules[$control->getName()] = $control->getRule();
            }
        }

        return $rules;
    }
654834
public function validateValidItem()
    {
        if (!$this->value) {
            return;
        }

        // load allowed values in values_list
        // @todo Imants: Actually we don't need to load all values from Model in
        //       array, just to check couple of posted values.
        //       Probably we should do SELECT * FROM t WHERE id IN ($values) or
        //       something like that to limit array size and time spent on
        //       parsing all DB records in Model.
        $this->getValueList();

        $values = explode($this->separator, $this->value);
        foreach ($values as $v) {
            if (!isset($this->value_list[$v])) {
                $this->displayFieldError("Value $v is not one of the offered values");

                return $this->validate();
            }
        }
    }
1154548
public function validate()
    {
		$returnValue = true;
		
		if(!$this->forcedValid){
			foreach($this->validators as $validator){
				if(!$validator->evaluate($this->getRawValue())){
					$this->error[] = $validator->getMessage();
					$returnValue = false;
					common_Logger::d($this->getName().' is invalid for '.$validator->getName(), array('TAO'));
                    if ($this->isBreakOnFirstError()){
                        break;
                    }
				}
			}
		}

        return $returnValue;
    }