Tells wether provided value is valid according to current type node.

@param mixed $value Value to validate.
@return bool
977329
public function isValid($value)
    {
        foreach ($this->typeNodes as $typeNode) {
            if ($typeNode->isValid($value)) {
                return true;
            }
        }

        return false;
    }
598000
public function isValueValid($value) {
		return $value instanceof Type\CreativeWork || $value instanceof Type\Product || $value instanceof DataType\URLType;
	}
227744
protected function validate($value)
    {
        $ret = ($value instanceof \Traversable ||
            $value instanceof \stdClass ||
            is_array($value));
        if (!$ret) {
            $this->messenger->add(new StringType('value is not traversable'));
        }

        return $ret;
    }
676751
protected function isValid($value)
    {
        if (is_null($value)) {
            return;
        }

        if (is_array($value) || ($value instanceof \ArrayAccess) || is_object($value)) {
            foreach ($this->options['shape'] as $key => $subValidator) {
                if (is_array($value) || ($value instanceof \ArrayAccess)) {
                    if (array_key_exists($key, $value)) {
                        $subValue = $value[$key];
                    } else {
                        $subValue = null;
                    }
                } elseif (ObjectAccess::isPropertyGettable($value, $key)) {
                    $subValue = ObjectAccess::getPropertyPath($value, $key);
                } else {
                    $subValue = null;
                }

                if ($subValidator instanceof ValidatorInterface) {
                    $subResult = $subValidator->validate($subValue);
                    if ($subResult->hasErrors()) {
                        $this->result->forProperty($key)->merge($subResult);
                    }
                }
            }
        } else {
            $this->addError('Shape-value is expected to be an array or implement ArrayAccess', 1515070099);
        }
    }
14798
public function isValueValid($value) {
		return $value instanceof Type\MonetaryAmount || $value instanceof DataType\NumberType || $value instanceof Type\PriceSpecification;
	}
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;
    }
1066951
public function isValid($value)
    {
        $this->_setValue($value);
        if ($this->getRecursive()) {
            $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($this->_haystack));
            foreach($iterator as $element) {
                if ($this->_strict) {
                    if ($element === $value) {
                        return true;
                    }
                } else if ($element == $value) {
                    return true;
                }
            }
        } else {
            if (in_array($value, $this->_haystack, $this->_strict)) {
                return true;
            }
        }

        $this->_error(self::NOT_IN_ARRAY);
        return false;
    }
5120
private function isValidType($value): bool
    {
        if ($this->type instanceof DataType) {
            return $this->type->isTheTypeOf($value);
        }

        return true;
    }
703350
public function isValid($value)
    {
        $this->checkDependencies();
        $doc = $this->getDocument($value);
        if (empty($doc->documentElement)) {
            $this->error = 'Invalid XML Document';
            return false;
        }

        $path = $this->pathResolver->getPath($doc);
        if (empty($path) || !file_exists($path)) {
            $this->error = "XSD Path: :'$path' not found";
            return false;
        }

        $valid = $this->schemaValidator->validate($doc, $path);
        $this->error = $valid ? '' : $this->getErrorMessage($this->schemaValidator->getErrors());

        return $valid;
    }
534753
protected function validate($value)
    {
        if (!$this->validators instanceof IValidatorCollection) {
            return true;
        }

        $isValid = $this->validators->isValid($value);
        $this->messages = $this->validators->getMessages();

        return $isValid;
    }
593835
public function isValueValid($value) {
		return $value instanceof DataType\TextType || $value instanceof Type\ThingType || $value instanceof DataType\URLType;
	}
1215652
public function isValueValid($value) {
		return $value instanceof Type\PropertyValueType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
616398
public function isValid($value)
    {
        $this->_setValue($value);
        if (!in_array($value, $this->_haystack, $this->_strict)) {
            $this->_error();
            return false;
        }
        return true;
    }
1229004
public function isValid($value)
    {
        try {
            if (null === \json_decode($value, true)) {
                return $this->_error(self::INVALID);
            }
        } catch (\Exception $e) {
            return $this->_error(self::INVALID);
        }
        return true;
    }
939899
public function isValueValid($value) {
		return $value instanceof DataType\NumberType || $value instanceof Type\QuantitativeValueType || $value instanceof DataType\TextType;
	}
634797
public function isValueValid($value) {
		return $value instanceof Type\DistanceType || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
505458
public function isValid($value) : bool
    {
        if ($value === null && $this->nullable) {
            return true;
        }

        return $value instanceof Metadata;
    }