Validate the value

@param mixed $value Value to check
@return bool False if invalid, true if valid
518247
protected function isValidCache($value): bool
    {
        $result = false;

        if ($value === false) {
            $this->warnings[] = 'Value not found in cache';

            return $result;
        }

        if (!is_array($value)) {
            $this->errors[] = "Cached value is not an array";

            return $result;
        }

        foreach ($this->requiredKeys as $key => $notEmpty) {
            // Key exists
            if (!array_key_exists($key, $value)) {
                $this->errors[] = "Cached value is missing '$key'";

                return $result;
            }
            // Value is not empty
            if ($notEmpty && empty($value[$key])) {
                $this->errors[] = "Cached value is empty for key '$key'";

                return $result;
            }
        }

        return true;
    }
132530
public function isValid($value)
    {
        if (!is_null($value) && !is_string($value) && !is_int($value) && !is_float($value) &&
            !is_bool($value) && !is_array($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        if (is_string($value) && (('' === $value) || preg_match('/^\s+$/s', $value))) {
            $this->_error(self::INVALID);
            return false;
        } elseif (is_int($value) && (0 === $value)) {
            return true;
        } elseif (!is_string($value) && empty($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        return true;
    }
945257
public function validate($value)
  {
    $this->reset();

    $this->value = $value;

    $this->validateRequired();
    $this->validateFilters();

    return $this->isValid();
  }
587879
protected function validatorValue($value)
    {
        if (!$value) {
            return $this->allowEmpty;
        }

        $pattern = str_replace('{schemes}', '(' . implode('|', $this->validSchemes) . ')', $this->pattern);
        if (preg_match($pattern, $value)) {
            return true;
        }

        return false;
    }
620762
public function isValueValid($value) {
		return $value instanceof Type\Product || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
135337
public function isValid($value)
    {
        $result = filter_var($value, FILTER_VALIDATE_INT);
        if (!$result) {
            $this->addMessage('number');
        }
        return ($result === false) ? false : true;
    }
1000801
public function isValueValid($value) {
		return $value instanceof Type\Distance || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
360606
protected function isValidValue($value)
    {
        $valid = true;
        if (is_array($value)) {
            $numericKeys = 0;
            foreach ($value as $k => $v) {
                $numericKeys += is_integer($k);
                if (!$this->isValidValue($v)) {
                    $valid = false;
                    break;
                }
            }
            if (!($numericKeys == 0 || $numericKeys == count($value))) {
                $valid = false;
            }
        } else {
            if (null !== $value && !is_scalar($value)) {
                $valid = false;
            }
        }
        return $valid;
    }
153355
public function isValid($value)
    {
        $result = (boolean) filter_var($value, FILTER_VALIDATE_URL);
        if (!$result) {
            $this->addMessage('url');
        }
        return $result;
    }
1288249
public function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }
        // Convert possible strings to number
        $number = $value + 0;

        return is_double($number) || !$this->strict && is_int($number);
    }
1260685
public function isValid($value)
    {
        $ok = true;
        
        if (!preg_match('/^[0-9]+(\.[0-9]+)?$/', $value)) {
            $this->error(self::SYNTAX);
            return false;
        }
        
        if ($value < $this->options['min']) {
            $this->error(self::MIN);
            $ok = false;
        }
        
        if ($value > $this->options['max']) {
            $this->error(self::MAX);
            $ok = false;
        }
        
        $parts = explode('.', $value);
        if (isset($parts[1]) && strlen($parts[1]) > $this->options['precision']) {
            if ($this->options['precision']) {
                $this->error(self::PRECISION);
            } else {
                $this->error(self::NO_COMMA);
            }
            $ok = false;
        }

        return $ok;
    }
937672
public function isValid($value)
    {
        $acceptedValues = GeneralUtility::trimExplode('|', $this->options['values']);

        if (false === in_array($value, $acceptedValues)) {
            $errorMessage = $this->translateErrorMessage('validator.has_values.not_valid', 'configuration_object', [implode(', ', $acceptedValues)]);
            $this->addError($errorMessage, 1456140151);
        }
    }
117248
public function validate($value)
    {
        $value = trim($value);
        return (is_string($value) && ($value === filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)));
    }
921302
public function isValid($value)
    {
        $this->_setValue($value);

        if (!is_string($value)) {
            $this->_error(self::INVALID, $value);
            return false;
        }

        if (!ctype_digit($value)) {
            $this->_error(self::CONTENT, $value);
            return false;
        }

        $length = strlen($value);
        $types  = $this->getType();
        $foundp = false;
        $foundl = false;
        foreach ($types as $type) {
            foreach ($this->_cardType[$type] as $prefix) {
                if (substr($value, 0, strlen($prefix)) == $prefix) {
                    $foundp = true;
                    if (in_array($length, $this->_cardLength[$type])) {
                        $foundl = true;
                        break 2;
                    }
                }
            }
        }

        if ($foundp == false){
            $this->_error(self::PREFIX, $value);
            return false;
        }

        if ($foundl == false) {
            $this->_error(self::LENGTH, $value);
            return false;
        }

        $sum    = 0;
        $weight = 2;

        for ($i = $length - 2; $i >= 0; $i--) {
            $digit = $weight * $value[$i];
            $sum += floor($digit / 10) + $digit % 10;
            $weight = $weight % 2 + 1;
        }

        if ((10 - $sum % 10) % 10 != $value[$length - 1]) {
            $this->_error(self::CHECKSUM, $value);
            return false;
        }

        if (!empty($this->_service)) {
            try {
                // require_once 'Zend/Validate/Callback.php';
                $callback = new Zend_Validate_Callback($this->_service);
                $callback->setOptions($this->_type);
                if (!$callback->isValid($value)) {
                    $this->_error(self::SERVICE, $value);
                    return false;
                }
            } catch (Zend_Exception $e) {
                $this->_error(self::SERVICEFAILURE, $value);
                return false;
            }
        }

        return true;
    }
507361
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = ComHashtagsDomainEntityHashtag::PATTERN_HASHTAG;

        return (is_string($value) && (preg_match($pattern, $value)) == 1);
    }
711071
public function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }

        return $value / $this->number == round($value / $this->number);
    }
1369914
public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);
        $result = Zend_Uri::check($value);
        if ($result !== true) {
            $this->_error(self::NOT_VALID);
            return false;
        }

        return true;
    }