Validates the checksum

@param  string $value The barcode to check the checksum for
@return boolean
179641
public function checksum($value)
    {
        $checksum = $this->getChecksum();
        if (!empty($checksum)) {
            if (method_exists($this, $checksum)) {
                return call_user_func(array($this, $checksum), $value);
            }
        }

        return false;
    }
655628
protected function checkValidity($value) : bool
    {
        if ('' === $value) {
            return true;
        }
        $date = date_create($value);
        if (false === $date) {
            return false;
        }
        return true;
    }
261712
protected function validateValue($value)
    {
        // strip empty lines
        $lines = array_filter(
            explode("\n", $value)
        );

        // strip comments (lines beginning with "#")
        $lines = array_filter($lines, function ($line) {
            $line = trim($line);

            return !empty($line) && $line[0] !== '#';
        });

        // validate each line
        foreach ($lines as $line) {
            if (!$this->validateLine($line)) {
                return false;
            }
        }

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

        $this->_setValue($value);
        $adapter       = $this->getAdapter();
        $this->_length = $adapter->getLength();
        $result        = $adapter->checkLength($value);
        if (!$result) {
            if (is_array($this->_length)) {
                $temp = $this->_length;
                $this->_length = "";
                foreach($temp as $length) {
                    $this->_length .= "/";
                    $this->_length .= $length;
                }

                $this->_length = substr($this->_length, 1);
            }

            $this->_error(self::INVALID_LENGTH);
            return false;
        }

        $result = $adapter->checkChars($value);
        if (!$result) {
            $this->_error(self::INVALID_CHARS);
            return false;
        }

        if ($this->getChecksum()) {
            $result = $adapter->checksum($value);
            if (!$result) {
                $this->_error(self::FAILED);
                return false;
            }
        }

        return true;
    }
706179
public function isValueValid($value) {
		return $value instanceof DataType\DateTimeType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
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;
    }
1280346
public function isValueValid($value) {
		return $value instanceof Type\ProductType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
1058883
private function check($value) {

		if(true === is_string($value) || is_numeric($value)) {

			if(true === $this -> strict) {
				return true === is_int($value);
			}

			return !in_array(preg_match('/^-?[0-9]+$/', $value), [false, 0]);
		}

		return false;
	}
14798
public function isValueValid($value) {
		return $value instanceof Type\MonetaryAmount || $value instanceof DataType\NumberType || $value instanceof Type\PriceSpecification;
	}
864250
protected function isValid($value)
    {
        if (is_null($value)) {
            return;
        }

        if (in_array($value, $this->options['values'], true)) {
            return;
        }

        $errorMessage = 'One of %s is expected.';

        if (is_string($value)) {
            $errorMessage .= sprintf(' Got "%s" instead.', $value);
        }

        $this->addError($errorMessage, 1514999090, [json_encode($this->options['values'])]);
    }
1159397
public function validate($value)
    {
        $value = trim($value);
        $pattern = '/^[a-z]{2}-[A-Z]{2}$/';
        return (empty($value))
                || (is_string($value) && preg_match($pattern, $value) == 1);
    }
1259765
public function isValueValid($value) {
		return $value instanceof Type\CreativeWorkType || $value instanceof Type\HowToSectionType || $value instanceof Type\HowToStepType || $value instanceof DataType\TextType;
	}
720629
protected function _code93($value)
    {
        $checksum = substr($value, -2, 2);
        $value    = str_split(substr($value, 0, -2));
        $count    = 0;
        $length   = count($value) % 20;
        foreach($value as $char) {
            if ($length == 0) {
                $length = 20;
            }

            $count += $this->_check[$char] * $length;
            --$length;
        }

        $check   = array_search(($count % 47), $this->_check);
        $value[] = $check;
        $count   = 0;
        $length  = count($value) % 15;
        foreach($value as $char) {
            if ($length == 0) {
                $length = 15;
            }

            $count += $this->_check[$char] * $length;
            --$length;
        }
        $check .= array_search(($count % 47), $this->_check);

        if ($check == $checksum) {
            return true;
        }

        return false;
    }
1296136
public function isValid($value)
    {
        $this->_setValue((string) $value);

        if (is_string($value)
            && (('' === $value) 
            || preg_match('/^\s+$/s', $value))
        ) {
            $this->_error();
            return false;
        } elseif (!is_string($value) && empty($value)) {
            $this->_error();
            return false;
        }

        return true;
    }
93488
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = '/\pL|[.#@_\s-0-9]/u';

        return is_string($value) && preg_replace($pattern, '', $value);
    }
44616
private function check($value) {

		if(true === is_string($value)) {
			return false === in_array(preg_match('/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/i', $value), [false, 0]);
		}

		return false;
	}
420987
protected function isValid($value)
    {
        if (!isset($this->options['locale'])) {
            $locale = $this->localizationService->getConfiguration()->getDefaultLocale();
        } elseif (is_string($this->options['locale'])) {
            $locale = new I18n\Locale($this->options['locale']);
        } elseif ($this->options['locale'] instanceof I18n\Locale) {
            $locale = $this->options['locale'];
        } else {
            $this->addError('The "locale" option can be only set to string identifier, or Locale object.', 1281286579);
            return;
        }

        $strictMode = $this->options['strictMode'];

        $formatLength = $this->options['formatLength'];
        NumbersReader::validateFormatLength($formatLength);

        $formatType = $this->options['formatType'];
        NumbersReader::validateFormatType($formatType);

        if ($formatType === NumbersReader::FORMAT_TYPE_PERCENT) {
            if ($this->numberParser->parsePercentNumber($value, $locale, $formatLength, $strictMode) === false) {
                $this->addError('A valid percent number is expected.', 1281452093);
            }
            return;
        } else {
            if ($this->numberParser->parseDecimalNumber($value, $locale, $formatLength, $strictMode) === false) {
                $this->addError('A valid decimal number is expected.', 1281452094);
            }
        }
    }