Check if rule passes
@param mixed $value
@return boolean
182996
private function check($value) {

		$ipv4 = new Ipv4();
		$ipv4 -> setValue($value);

		$ipv6 = new Ipv6();
		$ipv6 -> setValue($value);

		return true === $ipv4 -> isValid() || $ipv6 -> isValid();
	}
478569
protected function walkRuleChain($value, $rules)
    {
        foreach ($rules as $rule) {
            $filter = $this->filterLoader->getFilterForRule($rule);
            $value = $filter->apply($rule, $value);
        }

        return $value;
    }
750612
function Check($value)
    {
        $this->SetValue($value);
        $required = $this->GetRequiredValidator();
        if ($required && !$required->Check($value))
        {
            $this->checkFailed = true;
            return false;
        }
        return parent::Check($value);
    }
782286
public function isValid($value)
    {
        $this->_setValue($value);
        $token = $this->getToken();

        if (empty($token)) {
            $this->_error(self::MISSING_TOKEN);
            return false;
        }

        if ($value !== $token) {
            $this->_error(self::NOT_SAME);
            return false;
        }

        return true;
    }
1205714
protected function shouldEval($value) {
        switch ($value[0]) {
        case "exp":
            if ($value[1] == "/") {
                return $this->shouldEval($value[2], $value[3]);
            }
        case "var":
        case "fncall":
            return true;
        }
        return false;
    }
836559
private function check($value) {

		if(true === is_string($value)) {
			
			@json_decode($value);

	 		return true === (json_last_error() == JSON_ERROR_NONE);
	 	}

	 	return false;
	}
639181
public function isValid($value)
    {
        $this->_setValue($value);
        if (!is_string($value) && !is_int($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $format = $this->getFormat();
        if (!preg_match($format, $value)) {
            $this->_error(self::NO_MATCH);
            return false;
        }

        return true;
    }
592394
protected function _isSafeEchos($value)
    {
        return preg_match('#^([a-z\d_]+)\\(#', $value, $match) === 1 && in_array($match[1], $this->_safe_functions, true);
    }
322439
public function isValid($value)
    {
        if ($value == $this->allowName) {
            return true;
        }
        
        foreach ($this->getUser()->getGroups() as $group) {
            if ($group->getName() == $value) {
                $this->error(self::MSG_NOT_UNIQUE, $value);
                return false;
            }
        }
        return true;
    }
150889
public function Check($value)
    {
        if ($this->trimValue)
            $value = trim($value);
        $result = array();
        if (!preg_match($this->pattern, $value))
            $this->error = self::NoMatch;
        
        return $this->error == '';
    }
132040
protected function isValueTypeValidForExactConditions($value)
    {
        if (is_string($value) || is_bool($value) || is_int($value) || is_float($value)) {
            return true;
        }

        return false;
    }
66257
public function hasValue($value)
    {
        $index = array_search($value, $this->values);

        if ($index === false) {
            return false;
        }

        return true;
    }
298000
public function isValid($value)
    {
        $value = (string) $value;
        if (strlen($value) !== 10) {
            $this->_error(self::INVALID_NIP, $value);
            return false;
        }

        $intSum = 0;

        for ($i = 0; $i < 9; $i++) {
            $intSum += $this->_weights[$i] * $value[$i];
        }

        $int = $intSum % 11;
        $intControlNr = ($int === 10) ? 0 : $int;

        if ($intControlNr !== (int) $value[9]) {
            $this->_error(self::INVALID_NIP, $value);
            return false;
        }

        return true;
    }
937991
public function isValidDate($value)
    {
        if (!$value) {
            return false;
        }

        try {
            new \DateTime($value);

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
505755
protected function belowMinBorder($value): bool
    {
        if (null === $this->minDate) {
            return false;
        }

        if (!($value instanceof Datespan)) {
            throw new \LogicException('Given value must be of instance ' . Datespan::class);
        }

        return $value->startsBefore($this->minDate->change()->timeTo('00:00:00'));
    }
710656
protected function validate_ruletype($value) {
        if ($value === null) {
            return true;
        }

        if (!class_exists($value) || !is_subclass_of($value, 'core_competency\\competency_rule')) {
            return new lang_string('invaliddata', 'error');
        }

        return true;
    }
1040353
public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);
        $result = @preg_match(self::LASTMOD_REGEX, $value);
        if ($result != 1) {
            $this->_error(self::NOT_VALID);
            return false;
        }

        return true;
    }